aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-05-20 11:02:53 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2024-06-11 15:53:17 +0000
commit50862befdb2c33ad6b71f0c4c8ce3d455c92cffd (patch)
tree1510f43e92578710f926e47cdf8ad89848103b51 /gcc/rust/parse/rust-parse-impl.h
parent36a21ef17c09dccc03d6d84a4f37b06b1b9cf716 (diff)
downloadgcc-50862befdb2c33ad6b71f0c4c8ce3d455c92cffd.zip
gcc-50862befdb2c33ad6b71f0c4c8ce3d455c92cffd.tar.gz
gcc-50862befdb2c33ad6b71f0c4c8ce3d455c92cffd.tar.bz2
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.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index e22ad6d..b501c8e 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 ())
{