single_match
incorrectly lints on exhaustive matches inside of Option/Result
#11365
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
single_match
isn't supposed to lint on exhaustive matches of user-defined types, but it will if those are inside an Option or Result.Lint Name
single_match
Reproducer
I tried this code:
Clippy suggests this code:
I expected to see this happen:
Nothing,
single_match
should not trigger here since I've exhaustively listed every variant of my enum. It seems some specific carve-outs were added for Option/Result insingle_match
, but they're over-eager. The code clippy suggests is equivalent, right now, but if I were to add aTest::C
variant without remembering to handle it, clippy's version would not catch it.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: