needless_match doesn't consider the else
of if let
#8695
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
The
needless_match
lint produces a nonsensical suggestion in some cases. It seems like it fires entirely based on theif
-clause of anif let
, ignoring theelse
branch's value entirely. This is a regression, most likely from #8549 (but I haven't confirmed that).Lint Name
needless_match
Reproducer
I tried this code:
I saw this happen:
I expected to see no lint error.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: