summaryrefslogtreecommitdiffstats
path: root/tests/ui/for-loop-while/while-label.rs
blob: 5abc41daf94b8aa8f7f74a6ef8dde2880d5bd466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![allow(unreachable_code)]


pub fn main() {
    let mut i = 100;
    'w: while 1 + 1 == 2 {
        i -= 1;
        if i == 95 {
            break 'w;
            panic!("Should have broken out of loop");
        }
    }
    assert_eq!(i, 95);
}