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.
This commit is contained in:
bors 2022-10-14 07:00:38 +00:00
commit 36a70b7435
2 changed files with 19 additions and 2 deletions

View File

@ -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'

View File

@ -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"))