cannot forbid `dead_code` since lint triggers for third party macros
Open
Nobody has claimed this yet.
A-lints
C-bug
L-dead_code
T-clippy
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
if i, for example, forbid dead_code, clippy produces
error[E0453]: allow(dead_code) incompatible with previous forbid
|
| #[derive(Parser, Debug, Clone)]
| ^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
this is coming from clap's Parser derive macro, which i have no control over, so prevents me from forbidding dead_code in my own crate.
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
Start by reproducing the reported lint interaction with a Rust crate using clap's Parser derive macro and a command-line forbid(dead_code). Trace how the compiler handles lint levels emitted by third-party derive macros; done means the reported macro-generated allow(dead_code) no longer makes the user's forbid unusable.
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
- 35/100