summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/else-if-brace-style-closing-next-line.rs
blob: 3b885b3faaa5da0c6112b2374e4fe818730e9f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// rustfmt-control_brace_style: ClosingNextLine

fn main() {
    if false
    {
        ();
        ();
    }

    if false // lone if comment
    {
        ();
        ();
    }


    let a =
        if 0 > 1 {
            unreachable!()
        }
        else
        {
            0x0
        };


    if true
    {
        ();
    } else if false {
        ();
        ();
    }
    else {
        ();
        ();
        ();
    }

    if true // else-if-chain if comment
    {
        ();
    }
    else if false // else-if-chain else-if comment
    {
        ();
        ();
    } else // else-if-chain else comment
    {
        ();
        ();
        ();
    }
}