summaryrefslogtreecommitdiffstats
path: root/src/test/ui/label/label_break_value_unlabeled_break.rs
blob: fa0c70edc7881a5b9aa85289847c89dbf2b2474b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(label_break_value)]
#![allow(unused_labels)]

// Simple unlabeled break should yield in an error
fn unlabeled_break_simple() {
    'b: {
        break; //~ ERROR unlabeled `break` inside of a labeled block
    }
}

// Unlabeled break that would cross a labeled block should yield in an error
fn unlabeled_break_crossing() {
    loop {
        'b: {
            break; //~ ERROR unlabeled `break` inside of a labeled block
        }
    }
}

pub fn main() {}