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 09:33:33 +00:00
2018-05-12 07:52:20 +00: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() {}