os-rust/tests/ui/for-loop-while/while-label.rs

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

16 lines
261 B
Rust
Raw Normal View History

//@ run-pass
#![allow(unreachable_code)]
2014-07-25 20:12:51 -04:00
2014-07-25 20:12:51 -04:00
pub fn main() {
2015-01-25 22:05:03 +01:00
let mut i = 100;
'w: while 1 + 1 == 2 {
2014-07-25 20:12:51 -04:00
i -= 1;
if i == 95 {
break 'w;
panic!("Should have broken out of loop");
2014-07-25 20:12:51 -04:00
}
}
assert_eq!(i, 95);
}