Update a test

This commit is contained in:
Seiichi Uchida 2017-09-14 22:27:29 +09:00
parent 1f6801dd6a
commit 0215a1acb0
2 changed files with 17 additions and 14 deletions

View file

@ -54,7 +54,7 @@ fn test5() {
fn test6() {
let mut x = 0;
'outer: loop { // never loops
'outer: loop {
x += 1;
loop { // never loops
if x == 5 { break }
@ -112,6 +112,20 @@ fn test11<F: FnMut() -> i32>(mut f: F) {
}
}
pub fn test12(a: bool, b: bool) {
'label: loop {
loop {
if a {
continue 'label;
}
if b {
break;
}
}
break;
}
}
fn main() {
test1();
test2();
@ -124,5 +138,6 @@ fn main() {
test9();
test10();
test11(|| 0);
test12(true, false);
}

View file

@ -40,18 +40,6 @@ error: this loop never actually loops
50 | | }
| |_________^
error: this loop never actually loops
--> $DIR/never_loop.rs:57:5
|
57 | / 'outer: loop { // never loops
58 | | x += 1;
59 | | loop { // never loops
60 | | if x == 5 { break }
... |
63 | | return
64 | | }
| |__^
error: this loop never actually loops
--> $DIR/never_loop.rs:59:3
|
@ -80,5 +68,5 @@ error: this loop never actually loops
103 | | }
| |_____^
error: aborting due to 8 previous errors
error: aborting due to 7 previous errors