]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/label_break.rs
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
[rust.git] / src / tools / rustfmt / tests / target / label_break.rs
1 // format with label break value.
2 fn main() {
3     'empty_block: {}
4
5     'block: {
6         do_thing();
7         if condition_not_met() {
8             break 'block;
9         }
10         do_next_thing();
11         if condition_not_met() {
12             break 'block;
13         }
14         do_last_thing();
15     }
16
17     let result = 'block: {
18         if foo() {
19             // comment
20             break 'block 1;
21         }
22         if bar() {
23             /* comment */
24             break 'block 2;
25         }
26         3
27     };
28 }