Skip to content

used_underscore_binding is triggered for fields without underscore #13058

Open
@Bytekeeper

Description

@Bytekeeper

Summary

When running cargo clippy with the linked code (https://github.com/Bytekeeper/bevy_particle_systems/tree/bevy_14 - sorry for referencing the whole branch but this is just part of a PR for a project not owned by me)
I get a lot of used_underscore_binding warnings. The error message is quite funny as it prints out the definition, which has no underscores at all.

Lint Name

used_underscore_binding

Reproducer

Sorry - this is from a PR for another project, so here goes.
I tried this code:
https://github.com/abnormalbrain/bevy_particle_systems/pull/72/files

I expected to see this happen:
used_underscore_binding not triggered for fields without underscore.

note: `_texture` is defined here
  --> src/components.rs:58:9
   |
58 |         texture: Handle<Image>,
   |         ^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding

As you can see, there is no _texture here.

Instead, this happened:
used_underscore_binding triggered for fields without underscore.

Version

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-unknown-linux-gnu
release: 1.79.0
LLVM version: 18.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveT-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