(Big performance change) Do not run lints that cannot emit#125116
Merged
bors merged 7 commits intorust-lang:masterfrom Oct 26, 2024
Merged
(Big performance change) Do not run lints that cannot emit#125116bors merged 7 commits intorust-lang:masterfrom
bors merged 7 commits intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had
#![allow]ed them. This PR changes that. This change would improve both the Rust lint infrastructure and Clippy, but Clippy will see the most benefit, as it has about 900 registered lints (and growing!)So yeah, with this little patch we filter all lints pre-linting, and remove any lint that is either:
#![allow]ed in the whole crate,#[warn]or similar, and its default level isAllowAs some lints need to run, this PR also adds loadbearing lints. On a lint declaration, you can use the
@eval_always = truemarker to label it as loadbearing. A loadbearing lint will never be filtered (it will always run)Fixes #106983