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

Suggest existing lint name in unknown_lints lint suggestion #54737

Closed
phansch opened this issue Oct 2, 2018 · 1 comment
Closed

Suggest existing lint name in unknown_lints lint suggestion #54737

phansch opened this issue Oct 2, 2018 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@phansch
Copy link
Member

phansch commented Oct 2, 2018

It would be nice if the unknown_lints lint could suggest the correct lint name if a minor typo has been made.

For example using #![warn(dead_cod) should suggest dead_code.

Current output:

Compiling playground v0.0.1 (file:///playground)
warning: unknown lint: `dead_cod`
 --> src/main.rs:1:10
  |
1 | #![allow(dead_cod)]
  |          ^^^^^^^^
  |
  = note: #[warn(unknown_lints)] on by default

Expected output:

Compiling playground v0.0.1 (file:///playground)
warning: unknown lint: `dead_cod`
 --> src/main.rs:1:10
  |
1 | #![allow(dead_cod)]
  |          ^^^^^^^^ did you mean: `dead_code`?
  |
  = note: #[warn(unknown_lints)] on by default
@phansch
Copy link
Member Author

phansch commented Oct 2, 2018

I would like to work on this, too

@zackmdavis zackmdavis added the A-diagnostics Area: Messages for errors, warnings, and lints label Oct 2, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Dec 21, 2018
…li-obk

suggest similar lint names for unknown lints

Fixes rust-lang#54737.
pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 21, 2018
…li-obk

suggest similar lint names for unknown lints

Fixes rust-lang#54737.
Centril added a commit to Centril/rust that referenced this issue Dec 22, 2018
…li-obk

suggest similar lint names for unknown lints

Fixes rust-lang#54737.
kennytm added a commit to kennytm/rust that referenced this issue Dec 22, 2018
…li-obk

suggest similar lint names for unknown lints

Fixes rust-lang#54737.
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
Projects
None yet
Development

No branches or pull requests

2 participants