manual_filter
wrongly suggesting filter
when match has side-effects
#9766
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
manual_filter
lint's (#9451) suggestion can cause side-effect code to be removed.While the code can be rewritten to use
filter
correctly, the current suggestion will change the meaning of the code and is therefore wrong.Lint Name
manual_filter
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Either not triggering that lint or if it triggers suggesting something that doesn't remove the side-effect line (
println
).Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: