-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix false lint warnings in match arms with multiple patterns #14044
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
Conversation
This seems like a bit of a roundabout method of iterating over a pattern which is already solved by the |
Yes, it was because the visitor was visiting every Pattern of the match arm separately and, looked up if the NodeId of the pattern was in the |
That makes sense to me, but the real bug here seems to be that some identifiers in patterns were missing from the |
But to be precise, they are not used, only their common Ident |
I am not particularly familiar with |
When all patterns in an arm are processed sepatately, they don't know each other and I have to decide to raise an error in each iteration or not.
|
x = 21 | ||
} | ||
_ => {} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test where x
is not used mutable to verify the number of times the lint is printed?
Ok, let's take this strategy for now. Just a few comments and I think this is good to go! |
fix negative trait bound in outline view (rust-lang#14044) try to fix and close rust-lang#14044
fixing #13866