mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 17:53:56 +00:00
add never_loop tests
This commit is contained in:
parent
73a1dd8e7f
commit
a013568f70
@ -139,6 +139,19 @@ pub fn test13() {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test14() {
|
||||
let mut a = true;
|
||||
'outer: while a { // never loops
|
||||
while a {
|
||||
if a {
|
||||
a = false;
|
||||
continue
|
||||
}
|
||||
}
|
||||
break 'outer;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test1();
|
||||
test2();
|
||||
@ -153,5 +166,6 @@ fn main() {
|
||||
test11(|| 0);
|
||||
test12(true, false);
|
||||
test13();
|
||||
test14();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user