Skip to content

Commit 36a70b7

Browse files
committed
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.
2 parents a0ab61f + 4adf09b commit 36a70b7

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/ci.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,29 @@ jobs:
4545
- name: Cache Dependencies
4646
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
4747

48-
- name: Compile
48+
- name: Bump opt-level
49+
if: matrix.os == 'ubuntu-latest'
50+
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
51+
52+
- name: Compile (tests)
4953
run: cargo test --no-run --locked
5054

55+
# It's faster to `test` before `build` ¯\_(ツ)_/¯
56+
- name: Compile (rust-analyzer)
57+
if: matrix.os == 'ubuntu-latest'
58+
run: cargo build --quiet
59+
5160
- name: Test
5261
run: cargo test -- --nocapture --quiet
5362

63+
- name: Run analysis-stats on rust-analyzer
64+
if: matrix.os == 'ubuntu-latest'
65+
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .
66+
67+
- name: Run analysis-stats on rust std library
68+
if: matrix.os == 'ubuntu-latest'
69+
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
70+
5471
# Weird targets to catch non-portable code
5572
rust-cross:
5673
if: github.repository == 'rust-lang/rust-analyzer'

crates/syntax/src/ast/make.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub mod ext {
8989
}
9090

9191
pub fn ty_name(name: ast::Name) -> ast::Type {
92-
ty_path(ident_path(&format!("{name}")))
92+
ty_path(ident_path(&name.to_string()))
9393
}
9494
pub fn ty_bool() -> ast::Type {
9595
ty_path(ident_path("bool"))

0 commit comments

Comments
 (0)