make never_loop applicability more flexible
This commit is contained in:
parent
649cef0e81
commit
90dbc5bf94
6 changed files with 193 additions and 5 deletions
20
tests/ui/never_loop_fixable.rs
Normal file
20
tests/ui/never_loop_fixable.rs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue