-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
enabling a only a single lint is not intuitive #105104
Copy link
Copy link
Open
Labels
A-lint-levelsArea: lint levelsArea: lint levelsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Metadata
Metadata
Assignees
Labels
A-lint-levelsArea: lint levelsArea: lint levelsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Type
Fields
Give feedbackNo fields configured for issues without a type.
https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.E2.9C.94.20silencing.20all.20but.20one.20rustc.20lint
I wanted to do a simple task: silence all but one particular rustc lint.
rustc -Awarnings"allows" all the warnings, easy so we only need to re-warn a single lint:rustc -Awarnings -Wdead-codeAs it turns out this does not work,
-Awarningsdoes silence all lints, even the ones enabled again after the flag (order does not matter it seems).Similar thing works just fine with clippy:
clippy-driver -Aclippy::all -Wclippy::redundant_cloneonly warns about redundant clones`I found out I can archive this for rustc by passing
force-warnwith every lint manually, sorustc/clippy-driver -Awarnings --force-warn dead-code --force-warn clippy::redundant_clonebut this is kinda horribly UX imo.Can we just make
-Awarnings -Wunused_variableswork intuitively?