unnecessary_map_or
suggests code that does not compile
#14201
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
Uh oh!
There was an error while loading. Please reload this page.
Summary
The
unnecessary_map_or
lint can produce a suggestion that causes the resulting code to not compile. It suggests replacingmap_or(false, |v| v == x)
with== Some(x)
, but the problem is that isx
isn'tCopy
, thenSome(x)
movesx
, and it then cannot be used further.Lint Name
unnecessary_map_or
Reproducer
I tried this code:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: