Skip to content

False positive on similar_names? #2651

Closed
@darnir

Description

@darnir

The similar_names lint seems to be very strict with what it considers "similar". For example, I just had clippy give me this warning:

warning: binding's name is too similar to existing binding
  --> src/argparse.rs:53:5
   |
53 |     pub cache_util: f32,
   |     ^^^^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> src/main.rs:24:9
   |
24 | #![warn(similar_names)]
   |         ^^^^^^^^^^^^^
note: existing binding defined here
  --> src/argparse.rs:43:5
   |
43 |     pub input: InputType,
   |     ^^^^^^^^^^^^^^^^^^^^

Sure, both of these fields are part of the same struct, but I don't see how input and cache_util are similar or confusing looking variable names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingT-macrosType: Issues with macros and macro expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions