]> git.lizzy.rs Git - rust.git/blob - tests/target/control-brace-style-always-next-line.rs
Fix bug in identifying comments
[rust.git] / 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
11     'label: loop
12     // loop comment
13     {
14         ();
15     }
16
17
18     cond = true;
19     while cond
20     {
21         ();
22     }
23
24
25     'while_label: while cond
26     {
27         // while comment
28         ();
29     }
30
31
32     for obj in iter
33     {
34         for sub_obj in obj
35         {
36             'nested_while_label: while cond
37             {
38                 ();
39             }
40         }
41     }
42
43     match some_var
44     { // match comment
45         pattern0 => val0,
46         pattern1 => val1,
47         pattern2 | pattern3 =>
48         {
49             do_stuff();
50             val2
51         }
52     };
53 }