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); +}