gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_closure_param):
Replace parse_pattern with parse_pattern_no_alt.
gcc/testsuite/ChangeLog:
* rust/compile/closure_no_type_anno.rs: New test.
Signed-off-by: Mahmoud Mohamed <mahadelr19@gmail.com>
AST::AttrVec outer_attrs = parse_outer_attributes ();
// parse pattern (which is required)
- std::unique_ptr<AST::Pattern> pattern = parse_pattern ();
+ std::unique_ptr<AST::Pattern> pattern = parse_pattern_no_alt ();
if (pattern == nullptr)
{
// not necessarily an error
--- /dev/null
+// { dg-additional-options "-fsyntax-only" }
+
+pub fn foo() {
+ let a = |_| 15;
+}