2018-05-17 19:32:05 -05:00
|
|
|
#![allow(unused_labels)]
|
2018-05-12 04:33:33 -05:00
|
|
|
|
2018-05-12 02:52:20 -05:00
|
|
|
// 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() {}
|