make never_loop applicability more flexible

This commit is contained in:
lapla-cogito 2025-02-12 22:25:58 +09:00
parent 649cef0e81
commit 90dbc5bf94
No known key found for this signature in database
GPG key ID: A173204876C41CCC
6 changed files with 193 additions and 5 deletions

View file

@ -0,0 +1,20 @@
#![allow(clippy::iter_next_slice, clippy::needless_return)]
fn no_break_or_continue_loop() {
for i in [1, 2, 3].iter() {
//~^ never_loop
return;
}
}
fn no_break_or_continue_loop_outer() {
for i in [1, 2, 3].iter() {
//~^ never_loop
return;
loop {
if true {
continue;
}
}
}
}