shadow_unrelated incorrectly flags a destructuring assignment #10279
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
Summary
Clippy appears to incorrectly flag the second variable in a destructuring assignment as shadowing the first, even when the two variables are different.
I do not see this behavior with a destructuring let binding, even when they do shadow other variables.
Lint Name
shadow_unrelated
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No warnings should appear
Additional note:
If I change the flagged line to
let (start, end) = ...
(and remove the now-unnecessarymut
s), clippy is happy even though bothstart
andend
are indeed being shadowed (albeit not unrelated). So the issue seems to be related specifically to this destructuring assignment.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: