From: Pierre-Emmanuel Patry Date: Tue, 10 Oct 2023 12:16:52 +0000 (+0200) Subject: gccrs: Add new test for closure in closure parsing X-Git-Tag: basepoints/gcc-15~2082 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05ddae991b20754b36c46df8a64a630cc3e4d7e5;p=thirdparty%2Fgcc.git gccrs: Add new test for closure in closure parsing 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 --- diff --git a/gcc/testsuite/rust/compile/closure_in_closure.rs b/gcc/testsuite/rust/compile/closure_in_closure.rs new file mode 100644 index 000000000000..1a003070f6a7 --- /dev/null +++ b/gcc/testsuite/rust/compile/closure_in_closure.rs @@ -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); +}