needless_borrow
false positive in while loop
#10083
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
needless_borrow
lint error when we borrow a value in while loop. But following the suggestion will result in value moved error. I've provided a reproduction.Lint Name
needless_borrow
Reproducer
If we run clippy on the above code, the following error is thrown:
And if we try to follow the suggestion, we get the below error:
Version
Additional Labels
@rustbot label +l-suggestion-causes-error
The text was updated successfully, but these errors were encountered: