https://gcc.gnu.org/g:50862befdb2c33ad6b71f0c4c8ce3d455c92cffd
commit 50862befdb2c33ad6b71f0c4c8ce3d455c92cffd Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Date: Mon May 20 11:02:53 2024 +0200 Fix generic parameter parsing Generic parameter parsing failed when an outer attribute was used on it. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_generic_param): Change token reference to be the last token after all outer attributes have been parsed. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com> Diff: --- gcc/rust/parse/rust-parse-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index e22ad6d3c7c8..b501c8ecc8bd 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -3093,9 +3093,9 @@ template <typename EndTokenPred> std::unique_ptr<AST::GenericParam> Parser<ManagedTokenSource>::parse_generic_param (EndTokenPred is_end_token) { - auto token = lexer.peek_token (); auto outer_attrs = parse_outer_attribute (); std::unique_ptr<AST::GenericParam> param; + auto token = lexer.peek_token (); switch (token->get_id ()) {