mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
add never_loop test
This commit is contained in:
parent
346936a7c1
commit
d6b35f9839
1 changed files with 14 additions and 0 deletions
|
@ -126,6 +126,19 @@ pub fn test12(a: bool, b: bool) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn test13() {
|
||||
let mut a = true;
|
||||
loop { // infinite loop
|
||||
while a {
|
||||
if true {
|
||||
a = false;
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test1();
|
||||
test2();
|
||||
|
@ -139,5 +152,6 @@ fn main() {
|
|||
test10();
|
||||
test11(|| 0);
|
||||
test12(true, false);
|
||||
test13();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue