Skip to content

Commit 30a3673

Browse files
committed
Add rustfmt test for formatting for<> before closures
1 parent b504a18 commit 30a3673

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/tools/rustfmt/tests/source/closure.rs

+10
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ fn main() {
5151
"--emit=dep-info"
5252
} else { a }
5353
});
54+
55+
for<> || -> () {};
56+
for< >|| -> () {};
57+
for<
58+
> || -> () {};
59+
60+
for< 'a
61+
,'b,
62+
'c > |_: &'a (), _: &'b (), _: &'c ()| -> () {};
63+
5464
}
5565

5666
fn issue311() {

src/tools/rustfmt/tests/target/closure.rs

+6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ fn main() {
7171
a
7272
}
7373
});
74+
75+
for<> || -> () {};
76+
for<> || -> () {};
77+
for<> || -> () {};
78+
79+
for<'a, 'b, 'c> |_: &'a (), _: &'b (), _: &'c ()| -> () {};
7480
}
7581

7682
fn issue311() {

0 commit comments

Comments
 (0)