Skip to content

Order rust lints before clippy lints to allow ignoring unknown lints#4030

Open
erickt wants to merge 1 commit into
bazelbuild:mainfrom
erickt:patch-1
Open

Order rust lints before clippy lints to allow ignoring unknown lints#4030
erickt wants to merge 1 commit into
bazelbuild:mainfrom
erickt:patch-1

Conversation

@erickt
Copy link
Copy Markdown

@erickt erickt commented May 13, 2026

When updating the Rust toolchain in a quickly moving repository, it can be difficult to atomically fix all the lints and update the toolchain in a single commit. It can be helpful to:

  • land a patch that adds the flags -Aunknown_lints -Aclippy::useless_borrows_in_formatting. Rust needs them in that order, otherwise it will error out.
  • land the toolchain update.
  • clean up the remaining lint failures.

Unfortunately before this patch rules_rust would emit the clippy lints first, then the rustc lints, so we couldn't use this pattern. This patch reverses the order and fixes this issue.

When updating the Rust toolchain in a quickly moving repository, it can be difficult to atomically fix all the lints and update the toolchain in a single commit. It can be helpful to:

* land a patch that adds the flags `-Aunknown_lints -Aclippy::useless_borrows_in_formatting`. Rust needs them in that order, otherwise it will error out.
* land the toolchain update.
* clean up the remaining lint failures.

Unfortunately before this patch rules_rust would emit the clippy lints first, then the rustc lints, so we couldn't use this pattern. This patch reverses the order and fixes this issue.
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.

1 participant