Skip to content

Poor suggestion on missing colon from lint path flag #6986

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

Closed
dtolnay opened this issue Mar 27, 2021 · 0 comments · Fixed by rust-lang/rust#84959
Closed

Poor suggestion on missing colon from lint path flag #6986

dtolnay opened this issue Mar 27, 2021 · 0 comments · Fixed by rust-lang/rust#84959
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing E-medium Call for participation: Medium difficulty level problem and requires some initial experience.

Comments

@dtolnay
Copy link
Member

dtolnay commented Mar 27, 2021

$ cargo clippy -- -Dclippy:pedantic
    Checking testing v0.0.0 (/media/david/coding/git/testing)
error[E0602]: unknown lint: `clippy:pedantic`
  |
  = help: did you mean: `clippy::panic`
  = note: requested on the command line with `-D clippy:pedantic`

It seems "obvious" that clippy should be suggesting clippy::pedantic here, rather than clippy::panic. It seems to me it would be worth adding a heuristic targeted to the accidental single colon case, especially if the remaining part of the name after the colon is a real lint or lint group name.

Sorry if this is really rustc generating the correction not clippy, in which case this may be filed in the wrong place.


  • cargo clippy -V: clippy 0.1.53 (5e65467 2021-03-26)
  • rustc -Vv:
    rustc 1.53.0-nightly (5e65467ef 2021-03-26)
    binary: rustc
    commit-hash: 5e65467eff3d1da4712586d8402d1d2e1d6654bc
    commit-date: 2021-03-26
    host: x86_64-unknown-linux-gnu
    release: 1.53.0-nightly
    LLVM version: 12.0.0
    
@dtolnay dtolnay added the C-bug Category: Clippy is not doing the correct thing label Mar 27, 2021
@camsteffen camsteffen added the E-medium Call for participation: Medium difficulty level problem and requires some initial experience. label May 3, 2021
@camsteffen camsteffen self-assigned this May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing E-medium Call for participation: Medium difficulty level problem and requires some initial experience.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants