Skip to content

Clippy warns twice about unknown lints #6602

Closed
rust-lang/rust
#85053

Description

I tried this code:

#[warn(x)]
fn main() {}

I expected to see this happen: Clippy warns once that x is an unknown lint.

Instead, this happened: Clippy warns twice.

warning: unknown lint: `x`
 --> src/main.rs:1:8
  |
1 | #[warn(x)]
  |        ^
  |
  = note: `#[warn(unknown_lints)]` on by default

warning: unknown lint: `x`
 --> src/main.rs:1:8
  |
1 | #[warn(x)]
  |        ^

warning: 2 warnings emitted

Meta

  • cargo clippy -V: 0.1.51 (2021-01-16 8a65184)
  • rustc -V: 1.49.0

See also rust-lang/rust#80524 (comment) - this looks unrelated to the UNKNOWN_CLIPPY_LINTS pass because it shows up even with that disabled.

cc @flip1995

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

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions