Skip to content
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

used_underscore_binding is triggered for fields without underscore #13058

Open
Bytekeeper opened this issue Jul 6, 2024 · 2 comments
Open

used_underscore_binding is triggered for fields without underscore #13058

Bytekeeper opened this issue Jul 6, 2024 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have T-macros Type: Issues with macros and macro expansion

Comments

@Bytekeeper
Copy link

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
@Bytekeeper Bytekeeper added C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't labels Jul 6, 2024
@Bytekeeper
Copy link
Author

I cannot change the labels, but it's not I-false-negative - it's a false positive.

@alex-semenyuk
Copy link
Member

@rustbot label +i-false-positive -i-false-negative

@rustbot rustbot added the I-false-positive Issue: The lint was triggered on code it shouldn't have label Jul 6, 2024
@Alexendoo Alexendoo added T-macros Type: Issues with macros and macro expansion and removed I-false-negative Issue: The lint should have been triggered on code, but wasn't labels Jul 6, 2024
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 I-false-positive Issue: The lint was triggered on code it shouldn't have T-macros Type: Issues with macros and macro expansion
Projects
None yet
Development

No branches or pull requests

4 participants