Skip to content

internal: Run clippy as a separate CI step#21581

Open
Wilfred wants to merge 1 commit intorust-lang:masterfrom
Wilfred:clippy_in_ci
Open

internal: Run clippy as a separate CI step#21581
Wilfred wants to merge 1 commit intorust-lang:masterfrom
Wilfred:clippy_in_ci

Conversation

@Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Feb 3, 2026

Currently clippy is run in CI as part of the macOS build. This is a little confusing, because clippy failures just show as "Rust (macos-latest)" which make it look like a macOS build failure.

Instead, treat clippy as a separate build step, like miri and rustfmt.

This should also make CI a little faster, because it reduces macOS runner usage (which tend to be slower than Linux on GitHub actions), and it reduces the number of steps where we need to install clippy.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 3, 2026
@Wilfred
Copy link
Contributor Author

Wilfred commented Feb 4, 2026

Huh, this has found a new clippy issue in r-a:

error: casting to the same type is unnecessary (`f64` -> `f64`)
    --> crates/hir-ty/src/mir/eval.rs:1628:62
     |
1628 |                         rustc_type_ir::FloatTy::F64 => Owned((value as f64).to_le_bytes().to_vec()),
     |                                                              ^^^^^^^^^^^^^^ help: try: `{ value }`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_cast
     = note: `-D clippy::unnecessary-cast` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::unnecessary_cast)]`

Currently clippy is run in CI as part of the macOS build. This is a
little confusing, because clippy failures just show as
"Rust (macos-latest)" which make it look like a macOS build failure.

Instead, treat clippy as a separate build step, like miri and rustfmt.

This should also make CI a little faster, because it reduces macOS
runner usage (which tend to be slower than Linux on GitHub actions),
and it reduces the number of steps where we need to install clippy.
@Wilfred
Copy link
Contributor Author

Wilfred commented Feb 6, 2026

I've resolved the above issue, it doesn't occur when rust-src is installed. I'm happy to send a PR to fix the clippy issue too, but I don't want to inundate y'all with PRs. Let me know if you have a preference :)

@Veykril
Copy link
Member

Veykril commented Feb 7, 2026

yea lets just fix that with this PR, though the suggested fix is weird, the braces will also be unnecessary there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants