rust/src/test/ui/issues/issue-2216.rs
Bart Massey ed56f86781 Cleaned up unused labels
Deleted unused labels from compiler and fixed or allowed
unused labels in tests. This patch removes some gratuitous
unused labels and turns off the warning for unused labels
that are a necessary part of tests.  This will permit
setting the `unused_labels` lint to `warn`.
2019-11-15 16:31:30 -08:00

25 lines
421 B
Rust

// run-pass
#![allow(unreachable_code)]
pub fn main() {
let mut x = 0;
'foo: loop {
'bar: loop {
loop {
if 1 == 2 {
break 'foo;
}
else {
break 'bar;
}
}
continue 'foo;
}
x = 42;
break;
}
println!("{}", x);
assert_eq!(x, 42);
}