Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #13401 - lnicola:opt-tests, r=lnicola
Run `analysis-stats` on CI, with `opt-level = 1` We might want to run `analysis-stats` on PRs, and this makes it less unbearable.
bors 2022-10-14
parent a0ab61f · parent 4adf09b · commit 36a70b7
-rw-r--r--.github/workflows/ci.yaml19
-rw-r--r--crates/syntax/src/ast/make.rs2
2 files changed, 19 insertions, 2 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 1563ee0b14..7eda61848b 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -45,12 +45,29 @@ jobs:
- name: Cache Dependencies
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
- - name: Compile
+ - name: Bump opt-level
+ if: matrix.os == 'ubuntu-latest'
+ run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
+
+ - name: Compile (tests)
run: cargo test --no-run --locked
+ # It's faster to `test` before `build` ¯\_(ツ)_/¯
+ - name: Compile (rust-analyzer)
+ if: matrix.os == 'ubuntu-latest'
+ run: cargo build --quiet
+
- name: Test
run: cargo test -- --nocapture --quiet
+ - name: Run analysis-stats on rust-analyzer
+ if: matrix.os == 'ubuntu-latest'
+ run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .
+
+ - name: Run analysis-stats on rust std library
+ if: matrix.os == 'ubuntu-latest'
+ run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
+
# Weird targets to catch non-portable code
rust-cross:
if: github.repository == 'rust-lang/rust-analyzer'
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index c9a21e12c0..4057a75e7c 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -89,7 +89,7 @@ pub mod ext {
}
pub fn ty_name(name: ast::Name) -> ast::Type {
- ty_path(ident_path(&format!("{name}")))
+ ty_path(ident_path(&name.to_string()))
}
pub fn ty_bool() -> ast::Type {
ty_path(ident_path("bool"))