rust/tests/ui/for-loop-while/issue-2216.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
421 B
Rust
Raw Normal View History

// run-pass
#![allow(unreachable_code)]
pub fn main() {
2015-01-25 21:05:03 +00:00
let mut x = 0;
'foo: loop {
'bar: loop {
loop {
2015-01-25 21:05:03 +00:00
if 1 == 2 {
break 'foo;
}
else {
break 'bar;
}
}
continue 'foo;
}
x = 42;
break;
}
2014-10-15 01:07:11 +00:00
println!("{}", x);
assert_eq!(x, 42);
}