-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't run allowed lints #74704
Comments
@flip1995 mentioned that this is a hard problem in general:
https://github.com/rust-lang/rust-clippy/blob/06f190287848ceeee36be738cbbd8e008f3e7615/clippy_lints/src/utils/mod.rs#L1402 Also, this only works for |
We could put allow-by-default lints into a separate pass. Then disable the whole pass if all those lints are never enabled in the crate? |
Fixed by #125116 |
First noticed in https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Output.20of.20.60collector.20eprintln.60/near/204875468. If a lint is allowed, there is no need to run the lint pass. This could have large performance improvements for any crate where all lints are allowed (e.g. any dependency compiled by cargo, which uses
--cap-lints allow
).As a first pass this could check for
--cap-lints allow
and run no lints if so. In the future it could skip individual lints. Rustc would have to be careful not to skip lints that are#![allow]
ed at the crate level but re-enabled for individual items.The implementation would look similar to what I did in #73566 - override the query provider for
lint_mod
so that it doesn't run lints at all.The text was updated successfully, but these errors were encountered: