-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rust: Diagnose unused variable false positives #17656
Conversation
The pattern match on |
My work on macro expansion should fix the problem with variables "used" in macro invocations. |
@geoffw0 Could you include some code snippets as examples (aka test cases) in this issue? |
Fix for the |
That's great. Though the volume of FPs is breaking the DCA job, so I will probably have to implement a workaround until then.
Already here. :) |
I've just added a commit that restricts this query to working in files called |
Rust: Account for variables bound in `while let` expressions
We've seen a lot of false positive results in the wild for the new
rust/unused-variable
query. I've identified common three patterns, which are tested here:VariableAccessCand
, but notVariableAccess
).None
(I didn't manage to reproduce this issue with any otherenum
values).@hvitved do you think any of these have quick fixes I can implement here? Or should I write up issues for them?