From b451650faad43799f3a6159825c21b1c9bc8538f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 22 Jun 2025 15:36:03 +0200 Subject: [PATCH] Flag stable rustc/clippy warnings in CI Today, when a change introduces warnings, the change author might not see them. Fix that by making clippy fail on warnings. AFAICT, "clippy --deny-warnings" will also fail on rustc warnings. I'd imagine this is what most respectable Rust projects do. Pin stable rust so we won't get unrelated failures. Alternatively, we could keep using "dtolnay/rust-toolchain@stable", that should be fine too (as long as we have the capacity to quickly silence/iron out clippy failures). While at it, remove some unneeded dependencies. Keep gettext because that one might enable some cfg-directives (?). Other cfgs like feature="benchmark" and target_os != "linux" are not yet checked in CI. See #11584 --- .github/actions/rust-toolchain@stable/action.yml | 2 +- .github/workflows/rust_checks.yml | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/actions/rust-toolchain@stable/action.yml b/.github/actions/rust-toolchain@stable/action.yml index 6b428c610..2693fde13 100644 --- a/.github/actions/rust-toolchain@stable/action.yml +++ b/.github/actions/rust-toolchain@stable/action.yml @@ -16,7 +16,7 @@ permissions: runs: using: "composite" steps: - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@1.88 with: targets: ${{ inputs.targets }} components: ${{ inputs.components }} diff --git a/.github/workflows/rust_checks.yml b/.github/workflows/rust_checks.yml index cf27bbe36..1c0cbbbce 100644 --- a/.github/workflows/rust_checks.yml +++ b/.github/workflows/rust_checks.yml @@ -27,14 +27,9 @@ jobs: components: clippy - name: Install deps run: | - sudo apt install gettext libpcre2-dev - - name: cmake - run: | - cmake -B build + sudo apt install gettext - name: cargo clippy - # This used to have --deny=warnings, but that turns rust release day - # into automatic CI failure day, so we don't do that. - run: cargo clippy --workspace --all-targets + run: cargo clippy --workspace --all-targets -- --deny=warnings rustdoc: runs-on: ubuntu-latest