mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 18:40:57 +03:00
make never_loop applicability more flexible
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user