diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 07ff5aacec13..8479d006319f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,6 @@ env: CARGO_NET_RETRY: 10 CI: 1 RUST_BACKTRACE: short - RUSTFLAGS: "-D warnings" RUSTUP_MAX_RETRIES: 10 jobs: @@ -45,6 +44,9 @@ jobs: if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.proc_macros == 'true' name: proc-macro-srv runs-on: ubuntu-latest + env: + RUSTFLAGS: "-D warnings" + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -73,6 +75,7 @@ jobs: name: Rust runs-on: ${{ matrix.os }} env: + RUSTFLAGS: "-D warnings" CC: deny_c strategy: @@ -168,7 +171,7 @@ jobs: - name: Cache Dependencies uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 - - run: cargo +nightly miri test --locked + - run: cargo +nightly miri test -p intern --locked # Weird targets to catch non-portable code rust-cross: @@ -181,6 +184,7 @@ jobs: # The rust-analyzer binary is not expected to compile on WASM, but the IDE # crate should targets_ide: "wasm32-unknown-unknown" + RUSTFLAGS: "-D warnings" steps: - name: Checkout repository @@ -283,7 +287,7 @@ jobs: run: typos conclusion: - needs: [rust, rust-cross, typescript, typo-check, proc-macro-srv] + needs: [rust, rust-cross, typescript, typo-check, proc-macro-srv, miri] # We need to ensure this job does *not* get skipped if its dependencies fail, # because a skipped job is considered a success by GitHub. So we have to # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run diff --git a/crates/hir-ty/src/infer/closure.rs b/crates/hir-ty/src/infer/closure.rs index 69de555214d2..731b7f5e0286 100644 --- a/crates/hir-ty/src/infer/closure.rs +++ b/crates/hir-ty/src/infer/closure.rs @@ -223,7 +223,7 @@ impl HirPlace { kind: MutBorrowKind::Default | MutBorrowKind::TwoPhasedBorrow, }) = current_capture { - if self.projections[len..].iter().any(|it| *it == ProjectionElem::Deref) { + if self.projections[len..].contains(&ProjectionElem::Deref) { current_capture = CaptureKind::ByRef(BorrowKind::Mut { kind: MutBorrowKind::ClosureCapture }); } diff --git a/crates/project-model/src/build_dependencies.rs b/crates/project-model/src/build_dependencies.rs index 631787bf8e6f..b26d19e32689 100644 --- a/crates/project-model/src/build_dependencies.rs +++ b/crates/project-model/src/build_dependencies.rs @@ -343,11 +343,7 @@ impl WorkspaceBuildScripts { Message::CompilerArtifact(message) => { with_output_for(&message.package_id.repr, &mut |name, data| { progress(format!("building proc-macros: {name}")); - if message - .target - .kind - .iter() - .any(|k| *k == cargo_metadata::TargetKind::ProcMacro) + if message.target.kind.contains(&cargo_metadata::TargetKind::ProcMacro) { // Skip rmeta file if let Some(filename) = diff --git a/xtask/src/tidy.rs b/xtask/src/tidy.rs index bf51760de17a..343f76f6475e 100644 --- a/xtask/src/tidy.rs +++ b/xtask/src/tidy.rs @@ -254,7 +254,7 @@ impl TidyDocs { d.file_name() .unwrap_or_default() .to_str() - .map(|f_n| file_names.iter().any(|name| *name == f_n)) + .map(|f_n| file_names.contains(&f_n)) .unwrap_or(false) } }