From: Pierre-Emmanuel Patry Date: Wed, 1 Mar 2023 10:00:29 +0000 (+0100) Subject: gccrs: parser: Add RestPattern parsing X-Git-Tag: basepoints/gcc-15~2817 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9644897bb18bc625fa95f8dc3a6ed52d4c4c57a;p=thirdparty%2Fgcc.git gccrs: parser: Add RestPattern parsing Add simple RestPattern parsing to the pattern parsing function. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Handle RestPattern correctly. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index de693ebc296f..23171690d95a 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -10737,6 +10737,10 @@ Parser::parse_pattern_no_alt () lexer.skip_token (); return std::unique_ptr ( new AST::WildcardPattern (t->get_locus ())); + case DOT_DOT: + lexer.skip_token (); + return std::unique_ptr ( + new AST::RestPattern (t->get_locus ())); case REF: case MUT: return parse_identifier_pattern ();