Incorrect infinite loop detection when using breakpoint labels and continue #13511
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
If you have an outer loop that does terminate, and an inner loop that terminates by
continue
ing into the outer loop, clippy::infinite_loop will mark the inner loop as an infinite loop.Lint Name
clippy::infinite_loop
Reproducer
I tried this code:
I saw this happen:
It also triggered clippy::never-loop for the same loop which is silly.
I expected to see this happen:
No infinite loop warning triggered.
Version
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7
Additional Labels
No response
The text was updated successfully, but these errors were encountered: