gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_closure_expr): Advance tokens
properly when parsing closure param list.
gcc/testsuite/ChangeLog:
* rust/compile/closure_move_expr.rs: New test.
case PIPE:
// actually may have parameters
lexer.skip_token ();
+ t = lexer.peek_token ();
while (t->get_id () != PIPE)
{
if (lexer.peek_token ()->get_id () != COMMA)
{
+ lexer.skip_token ();
// not an error but means param list is done
break;
}
--- /dev/null
+// { dg-additional-options "-fsyntax-only" }
+
+fn foo() {
+ move |l: u32, r: u32| l + r
+}
+
+fn foo2() {
+ |l: u32, r: u32| l + r
+}