False positive in a loop that uses let/else #10085
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
Using let/else rather than an alternative block of code doing the same thing causes clippy to think that a loop never actually loops.
Lint Name
clippy::never_loop
Reproducer
This repository demonstrates the problem:
https://github.com/shinypb/rust-clippy-loop-false-positive
I tried this code:
I saw this happen:
Changing my code to avoid the let/else makes the problem go away (yes, this is a very gross way of doing that; I am just trying to have a minimal patch for the purposes of this example 😅 ):
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: