needless_borrow false positive: if
and else
have incompatible types
#9739
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
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
If you have a function accepting both a slice and an array, the
needless_borrow
lint suggests you to turn the slice into an array. Most times this works, but if you have an else/if with differently sized slices in the then/else bodies, applying the lint's suggestion causes a compilation error.Lint Name
needless_borrow
Reproducer
I tried this code:
I saw this happen:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: