]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/label_break.rs
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
[rust.git] / src / tools / rustfmt / tests / source / label_break.rs
1 // format with label break value.
2 fn main() {
3
4 'empty_block: {}
5
6 'block: {
7     do_thing();
8     if condition_not_met() {
9         break 'block;
10     }
11     do_next_thing();
12     if condition_not_met() {
13         break 'block;
14     }
15     do_last_thing();
16 }
17
18 let result = 'block: {
19     if foo() {
20         // comment
21         break 'block       1;
22     }
23     if bar() { /* comment */
24         break 'block      2;
25     }
26     3
27 };
28 }