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

Passing -W for an unknown lint gives an error without saying why #74722

Closed
jyn514 opened this issue Jul 24, 2020 · 6 comments · Fixed by #115387
Closed

Passing -W for an unknown lint gives an error without saying why #74722

jyn514 opened this issue Jul 24, 2020 · 6 comments · Fixed by #115387
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Jul 24, 2020

$ rustc -W unknown_blah ~/src/test-rustdoc/test.rs 
error[E0602]: unknown lint: `unknown_blah`
  |
  = note: requested on the command line with `-W unknown_blah`

Not sure if this is actually a bug? cc @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

We should at least give a brief blurb about how to silence this. (Does -Wunknown-lints help?)

@JohnTitor JohnTitor added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 24, 2020
@jyn514
Copy link
Member Author

jyn514 commented Feb 9, 2021

(Does -Wunknown-lints help?)

It does not.

$ rustc -Aunknown-lints -Alegacy-derive-helpers hello.rs
error[E0602]: unknown lint: `legacy_derive_helpers`
  |
  = note: requested on the command line with `-A legacy_derive_helpers`

@jyn514 jyn514 added the A-driver Area: rustc_driver that ties everything together into the `rustc` compiler label Feb 9, 2021
@tmandry
Copy link
Member

tmandry commented Feb 9, 2021

Copying what I said in #81906:

Since the same problem that unknown-lints solves exists on the command line, I'd argue that this is a bug in the CLI.

As a corollary, it would be nice if we could do something like -Aunknown-lints -Alegacy-derive-helpers -Dunknown-lints to prevent misspellings elsewhere in the command line.

@djkoloski
Copy link
Contributor

#94274 fixes the issue of -Aunknown-lints not applying to subsequent CLI arguments.

@Herschel
Copy link
Contributor

Herschel commented May 22, 2022

I ran into this when adopting Embark's workaround for using .cargo/config.toml to allow/disable lints for an entire workspace via rustflags. I'd like to -Aunknown_lints here and then squelch certain nightly clippy lints, but subsequent -Afoobar still give me errors.

#94274 fixes the issue of -Aunknown-lints not applying to subsequent CLI arguments.

This makes it sound like the above should work correctly, but I guess I'm mistaken? rustc 1.63.0-nightly (9257f5a 2022-05-21)

@ComputerDruid
Copy link
Contributor

I think #94274 only helps with unstable lints, not unknown ones, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants