refactor(lints): Pull out unknown_lints lint logic and missing_lints_features diagnostic logic#16976
Conversation
Move each part closer to actual use with the assumption that this will be easier to read.
|
r? @ehuss rustbot has assigned @ehuss. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This is an audit to make sure all lints are registered but we will soon have diagnostics as well.
| continue; | ||
| } | ||
| let content = std::fs::read_to_string(&path).unwrap(); | ||
| if !content.contains("LINT") { |
There was a problem hiding this comment.
Should we be more paranoid checking static LINT in case it might accidentally matches? Or should we list diagnostic files out explicitly?
There was a problem hiding this comment.
If we do static LINT, we could miss some things as diagnostics. I figured it would be good to err on the being as permissive as possible.
As for a diagnostic list, maybe? In theory, we should have more lints than diagnostics but likely the first step towards making many of our deferred warning diagnostics into lints is to pull them out as dedicated diagnostics.
I also want to play with unused item warnings to help manage this. If we switch them from pub to pub(crate), we might be able to have the compiler help us catch missing ones. I just didn't want this to be blocked on that experiment and getting consensus on merging it.
Now that we more formally have a diagnostic in here (rust-lang#16976), let's make the broader intent more clear. See rust-lang#16975 for background on where this is going.
### What does this PR try to resolve? Now that we more formally have a diagnostic in here (rust-lang#16976), let's make the broader intent more clear. See rust-lang#16975 for background on where this is going. ### How to test and review this PR?
Update cargo submodule 13 commits in 4f9b52075316e9ced380c8fa492858048d5758b6..a343accce8526b128adc517d33348573d22920a3 2026-05-01 22:36:41 +0000 to 2026-05-08 22:41:35 +0000 - docs(guide): Fix a typo (rust-lang/cargo#16980) - chore(deps): update msrv (3 versions) to v1.93 (rust-lang/cargo#16979) - refactor(diag): Move lints to diagnostics (rust-lang/cargo#16978) - refactor(lints): Pull out `unknown_lints` lint logic and `missing_lints_features` diagnostic logic (rust-lang/cargo#16976) - refactor(lints): Move things out of `lints/mod.rs` (rust-lang/cargo#16975) - test: cover search API redirects (rust-lang/cargo#16971) - refactor(lints): Instrument lints for logging (rust-lang/cargo#16972) - docs: `.cargo-checksum.json` is not a security mechanism (rust-lang/cargo#16966) - fix(vendor): add `$comment` to `.cargo-checksum.json` (rust-lang/cargo#16967) - test: Fixed arg order in rustdoc json test (rust-lang/cargo#16968) - fix(config): `[env]` relative paths definition (rust-lang/cargo#16957) - fix(config): normalize included config paths (rust-lang/cargo#16964) - Fix heading level of `build.warnings` documentation. (rust-lang/cargo#16961) r? ghost
What does this PR try to resolve?
This builds on #16975, showing that we already have a diagnostic among our lints.
How to test and review this PR?