Skip to content

internal: Run clippy as a separate CI step#21581

Merged
Veykril merged 1 commit intorust-lang:masterfrom
Wilfred:clippy_in_ci
Feb 11, 2026
Merged

internal: Run clippy as a separate CI step#21581
Veykril merged 1 commit intorust-lang:masterfrom
Wilfred:clippy_in_ci

Conversation

@Wilfred
Copy link
Copy Markdown
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
Copy Markdown
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)]`

@Wilfred
Copy link
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
Contributor Author

Wilfred commented Feb 9, 2026

OK, fixed the clippy warning too.

@Veykril Veykril added this pull request to the merge queue Feb 11, 2026
Merged via the queue into rust-lang:master with commit 4bb462f Feb 11, 2026
16 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 11, 2026
@Wilfred Wilfred deleted the clippy_in_ci branch February 12, 2026 11:45
@lnicola
Copy link
Copy Markdown
Member

lnicola commented Feb 16, 2026

It doesn't seem to be the case any more, but at one point macOS runners were actually faster than the x64 Linux ones.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants