]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/control-brace-style-always-next-line.rs
Rollup merge of #84048 - konan8205:master, r=jsha
[rust.git] / src / tools / rustfmt / tests / target / control-brace-style-always-next-line.rs
1 // rustfmt-control_brace_style: AlwaysNextLine
2
3 fn main() {
4     loop
5     {
6         ();
7         ();
8     }
9
10     'label: loop
11     // loop comment
12     {
13         ();
14     }
15
16     cond = true;
17     while cond
18     {
19         ();
20     }
21
22     'while_label: while cond
23     {
24         // while comment
25         ();
26     }
27
28     for obj in iter
29     {
30         for sub_obj in obj
31         {
32             'nested_while_label: while cond
33             {
34                 ();
35             }
36         }
37     }
38
39     match some_var
40     {
41         // match comment
42         pattern0 => val0,
43         pattern1 => val1,
44         pattern2 | pattern3 =>
45         {
46             do_stuff();
47             val2
48         }
49     };
50 }