Clippy fails to auto-fix search_is_some
issue when .then_some()
is used
#11910
Labels
C-bug
Category: Clippy is not doing the correct thing
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
When
clippy
attempted to auto-fix an instance ofsearch_is_some
, there was a compiler error.The use of
.any()
is followed by.then_some(...)
so it needs to add parentheses around the part it's negating with!
rather than attempting to negate the entire expression (you can't 'negate'Option<T>
).Reproducer
I tried this code:
I expected to see this happen:
Instead, this happened:
Version
Additional Labels
@rustbot labels +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: