Warn when more specific lint overridden by a lint group
Open
Nobody has claimed this yet.
A-diagnostics
A-lints
C-discussion
T-compiler
T-lang
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
#![deny(dead_code)]
#![allow(unused)]
fn f() {}
fn main() {}
Current output
No output
Desired output
warning: `#![deny(dead_code)]` at line `1` does not have any effect as it is overridden by `#![allow(unused)]` at line `2`
help: put the more specific lint after or remove it.
Rationale and extra context
No response
Other cases
Rust Version
latest nightly and stable.
Anything else?
@rustbot label +A-lint
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the Rust snippet on the latest stable and nightly toolchains, comparing the current output with the requested warning and help text. Trace the compiler's lint precedence handling and add coverage for the specific lint being overridden by a lint group; done means the diagnostic appears with the relevant source lines while unaffected cases remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100