Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling a only a single lint is not intuitive #105104

Open
matthiaskrgr opened this issue Nov 30, 2022 · 0 comments
Open

enabling a only a single lint is not intuitive #105104

matthiaskrgr opened this issue Nov 30, 2022 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics

Comments

@matthiaskrgr
Copy link
Member

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-code
As it turns out this does not work, -Awarnings does 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_clone only warns about redundant clones`

I found out I can archive this for rustc by passing force-warn with every lint manually, so
rustc/clippy-driver -Awarnings --force-warn dead-code --force-warn clippy::redundant_clone but this is kinda horribly UX imo.

Can we just make -Awarnings -Wunused_variables work intuitively?

@matthiaskrgr matthiaskrgr added A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. WG-diagnostics Working group: Diagnostics labels Nov 30, 2022
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants