mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-13 04:26:48 +00:00
add never_loop test
This commit is contained in:
parent
346936a7c1
commit
d6b35f9839
@ -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…
Reference in New Issue
Block a user