Skip to content

Commit

Permalink
Add new test for closure in closure parsing
Browse files Browse the repository at this point in the history
This new test highlight the fix of #2656.

gcc/testsuite/ChangeLog:

	* rust/compile/closure_in_closure.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
  • Loading branch information
P-E-P committed Oct 17, 2023
1 parent 0af6a9f commit 25eb53d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gcc/testsuite/rust/compile/closure_in_closure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// { dg-additional-options "-frust-compile-until=ast" }
//
// Do not reformat this test! The default rust format settings will insert a
// space between closure parameter lists.
fn main() {
let f = |_||x, y| x+y;
assert_eq!(f(())(1, 2), 3);
}

0 comments on commit 25eb53d

Please sign in to comment.