Skip to content

Commit 36839de

Browse files
hdshawkw
andauthored
chore: Use fixed Rust version for clippy (and fmt) (#413)
In Rust 1.69.0, the `almost_swapped` lint was enhanced and now triggers on the clap 3.x `Subcommand` derive macro. Unfortunately the macro includes `#[deny(clippy::correctness)]` (which implies denying `almost_swapped`), and so it can't be overridden. This issue doesn't exist in clap 4.x, it was fixed already. Until either the fix is backported to clap 3.x or we switch to clap 4.x., this change fixes the Rust version used for clippy (and by extension rustfmt) to the previous version 1.68.2. Co-authored-by: Eliza Weisman <[email protected]>
1 parent ac20daa commit 36839de

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/ci.yaml

+8-7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ env:
2525
RUSTUP_MAX_RETRIES: 10
2626
# Don't emit giant backtraces in the CI logs.
2727
RUST_BACKTRACE: short
28+
# Use Rust 1.68.2 for Clippy (and fmt) because of an enhanced `almost_swapped`
29+
# lint in 1.69.0 which affects clap 3 and can't be `allow`ed.
30+
RUST_FMT_CLIPPY: 1.68.2
31+
2832

2933
jobs:
3034
check:
@@ -105,14 +109,11 @@ jobs:
105109
- name: Checkout sources
106110
uses: actions/checkout@v3
107111

108-
- name: Install stable toolchain
109-
uses: actions-rs/toolchain@v1
112+
- name: Install Rust ${{ env.RUST_FMT_CLIPPY }}
113+
uses: dtolnay/rust-toolchain@master
110114
with:
111-
profile: minimal
112-
toolchain: stable
113-
override: true
114-
components: rustfmt, clippy
115-
- uses: Swatinem/rust-cache@v1
115+
toolchain: ${{ env.RUST_FMT_CLIPPY }}
116+
components: clippy, rustfmt
116117

117118
- name: Run cargo fmt
118119
uses: actions-rs/cargo@v1

0 commit comments

Comments
 (0)