rust/src/test/run-pass/issue-2216.rs
Tim Chevalier dd66e7549b Preliminary support for labeled break/continue for loops
This patch adds preliminary middle-end support (liveness and trans)
for breaks and `loop`s to `loop` constructs that have labels.

while and for loops can't have labels yet.

Progress on #2216
2012-10-22 09:20:37 -07:00

22 lines
373 B
Rust

fn main() {
let mut x = 0;
loop foo: {
loop bar: {
loop quux: {
if 1 == 2 {
break foo;
}
else {
break bar;
}
}
loop foo;
}
x = 42;
break;
}
error!("%?", x);
assert(x == 42);
}