summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/unindent_if_else_cond_comment.rs
blob: 98621b1eed150f437766f4afd4eaee867adbbaf5 (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
// Comments on else block. See #1575.

fn example() {
    // `if` comment
    if x {
        foo();
    // `else if` comment
    } else if y {
        foo();
    // Comment on `else if`.
    // Comment on `else if`.
    } else if z {
        bar();
    /*
     *  Multi line comment on `else if`
     */
    } else if xx {
        bar();
    /* Single line comment on `else if` */
    } else if yy {
        foo();
    // `else` comment
    } else {
        foo();
        // Comment at the end of `else` block
    };
}