From f026688c2abd95fdfabe50ace0a422004d4c47d5 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Sun, 3 Jul 2022 16:11:46 +0400 Subject: [PATCH] Add rustfmt test for formatting `for<>` before closures --- tests/source/closure.rs | 10 ++++++++++ tests/target/closure.rs | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/tests/source/closure.rs b/tests/source/closure.rs index e93cc3fb40f..b2d28b305d0 100644 --- a/tests/source/closure.rs +++ b/tests/source/closure.rs @@ -51,6 +51,16 @@ fn main() { "--emit=dep-info" } else { a } }); + + for<> || -> () {}; + for< >|| -> () {}; + for< +> || -> () {}; + +for< 'a + ,'b, +'c > |_: &'a (), _: &'b (), _: &'c ()| -> () {}; + } fn issue311() { diff --git a/tests/target/closure.rs b/tests/target/closure.rs index f3107d19c2f..e8b4ff7a96b 100644 --- a/tests/target/closure.rs +++ b/tests/target/closure.rs @@ -71,6 +71,12 @@ fn main() { a } }); + + for<> || -> () {}; + for<> || -> () {}; + for<> || -> () {}; + + for<'a, 'b, 'c> |_: &'a (), _: &'b (), _: &'c ()| -> () {}; } fn issue311() {