Skip to content

Commit

Permalink
Auto merge of #125116 - blyxyas:ignore-allowed-lints-final, r=cjgillot
Browse files Browse the repository at this point in the history
(Big performance change) Do not run lints that cannot emit

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:
- Manually `#![allow]`ed in the whole crate,
- Allowed in the command line, or
- Not manually enabled with `#[warn]` or similar, and its default level is `Allow`

As some lints **need** to run, this PR also adds **loadbearing lints**. On a lint declaration, you can use the ``@eval_always` = true` marker to label it as loadbearing. A loadbearing lint will never be filtered (it will always run)

Fixes #106983
  • Loading branch information
bors committed Oct 26, 2024
2 parents c1cba5b + d908c3d commit e3b428c
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit e3b428c

Please sign in to comment.