Skip to content

Commit

Permalink
Add rustfmt test for formatting for<> before closures
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Jul 12, 2022
1 parent b504a18 commit 30a3673
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tools/rustfmt/tests/source/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ fn main() {
"--emit=dep-info"
} else { a }
});

for<> || -> () {};
for< >|| -> () {};
for<
> || -> () {};

for< 'a
,'b,
'c > |_: &'a (), _: &'b (), _: &'c ()| -> () {};

}

fn issue311() {
Expand Down
6 changes: 6 additions & 0 deletions src/tools/rustfmt/tests/target/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ fn main() {
a
}
});

for<> || -> () {};
for<> || -> () {};
for<> || -> () {};

for<'a, 'b, 'c> |_: &'a (), _: &'b (), _: &'c ()| -> () {};
}

fn issue311() {
Expand Down

0 comments on commit 30a3673

Please sign in to comment.