]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/unindent_if_else_cond_comment.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / rustfmt / tests / target / unindent_if_else_cond_comment.rs
1 // Comments on else block. See #1575.
2
3 fn example() {
4     // `if` comment
5     if x {
6         foo();
7     // `else if` comment
8     } else if y {
9         foo();
10     // Comment on `else if`.
11     // Comment on `else if`.
12     } else if z {
13         bar();
14     /*
15      *  Multi line comment on `else if`
16      */
17     } else if xx {
18         bar();
19     /* Single line comment on `else if` */
20     } else if yy {
21         foo();
22     // `else` comment
23     } else {
24         foo();
25         // Comment at the end of `else` block
26     };
27 }