Skip to content

Suggest existing lint name in unknown_lints lint suggestion #54737

Closed
@phansch

Description

@phansch
Member

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

phansch

phansch commented on Oct 2, 2018

@phansch
MemberAuthor

I would like to work on this, too

added a commit that references this issue on Dec 21, 2018

Rollup merge of rust-lang#56992 - euclio:unknown-lint-suggestion, r=o…

fbe0717
added a commit that references this issue on Dec 22, 2018

Rollup merge of rust-lang#56992 - euclio:unknown-lint-suggestion, r=o…

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

Metadata

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

        Participants

        @zackmdavis@phansch

        Issue actions

          Suggest existing lint name in `unknown_lints` lint suggestion · Issue #54737 · rust-lang/rust