Skip to content

Suggest existing lint name in unknown_lints lint suggestion #54737

Closed
@phansch

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions