rust/crates/syntax/test_data/parser/ok/0033_label_break.rs

29 lines
506 B
Rust
Raw Normal View History

2018-09-08 01:18:42 -05:00
// format with label break value.
fn main() {
'empty_block: {}
'block: {
do_thing();
if condition_not_met() {
break 'block;
}
do_next_thing();
if condition_not_met() {
break 'block;
}
do_last_thing();
}
let result = 'block: {
if foo() {
// comment
break 'block 1;
}
if bar() {
/* comment */
break 'block 2;
}
3
};
}