]> git.lizzy.rs Git - rust.git/blob - tests/target/else-if-brace-style-closing-next-line.rs
Fix bug in identifying comments
[rust.git] / tests / target / else-if-brace-style-closing-next-line.rs
1 // rustfmt-single_line_if_else_max_width: 0
2 // rustfmt-control_brace_style: ClosingNextLine
3
4 fn main() {
5     if false {
6         ();
7         ();
8     }
9
10     if false
11     // lone if comment
12     {
13         ();
14         ();
15     }
16
17
18     let a = if 0 > 1 {
19         unreachable!()
20     }
21     else {
22         0x0
23     };
24
25
26     if true {
27         ();
28     }
29     else if false {
30         ();
31         ();
32     }
33     else {
34         ();
35         ();
36         ();
37     }
38
39     if true
40     // else-if-chain if comment
41     {
42         ();
43     }
44     else if false
45     // else-if-chain else-if comment
46     {
47         ();
48         ();
49     }
50     else
51     // else-if-chain else comment
52     {
53         ();
54         ();
55         ();
56     }
57 }