rust/tests/ui/label/label_break_value_unlabeled_break.rs

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

20 lines
438 B
Rust
Raw Normal View History

#![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() {}