]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Merge #1812
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Fri, 3 Feb 2023 12:45:58 +0000 (12:45 +0000)
committerGitHub <noreply@github.com>
Fri, 3 Feb 2023 12:45:58 +0000 (12:45 +0000)
1812: parser: Allow parsing multiple reference types r=CohenArthur a=CohenArthur

The parser now recursively tries to parse a reference type after seeing a `&` or `&&` token.

gcc/rust/ChangeLog:

* parse/rust-parse-impl.h (Parser::parse_type): Handle double ampersan properly (Parser::parse_reference_type): Call into `parse_reference_type_inner` and wrap double reference types in another `AST::ReferenceType` node (Parser::parse_reference_type_inner): Add parsing implementation which does not care about the leading token (& or  &&) (Parser::parse_type_no_bounds): Handle double ampersand properly
* parse/rust-parse.h: Declare `parse_reference_type_inner`

gcc/testsuite/ChangeLog:

* rust/compile/multi_reference_type.rs: New test.

Addresses #1807 partly

Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
1  2 
gcc/rust/parse/rust-parse-impl.h

Simple merge