]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/else-if-brace-style-always-next-line.rs
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
[rust.git] / src / tools / rustfmt / tests / source / else-if-brace-style-always-next-line.rs
1 // rustfmt-control_brace_style: AlwaysNextLine
2
3 fn main() {
4     if false
5     {
6         ();
7         ();
8     }
9
10     if false // lone if comment
11     {
12         ();
13         ();
14     }
15
16
17     let a =
18         if 0 > 1 {
19             unreachable!()
20         }
21         else
22         {
23             0x0
24         };
25
26
27     if true
28     {
29         ();
30     } else if false {
31         ();
32         ();
33     }
34     else {
35         ();
36         ();
37         ();
38     }
39
40     if true // else-if-chain if comment
41     {
42         ();
43     }
44     else if false // else-if-chain else-if comment
45     {
46         ();
47         ();
48     } else // else-if-chain else comment
49     {
50         ();
51         ();
52         ();
53     }
54 }