]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Fix tokenstream QualifiedPathInExpression
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 17 Apr 2023 16:26:03 +0000 (18:26 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:09 +0000 (18:34 +0100)
The associated type was not kept in the tokenstream.

gcc/rust/ChangeLog:

* ast/rust-ast-tokenstream.cc (TokenStream::visit): Keep
associated type.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-tokenstream.cc

index 67b122a90891642f11b3e70f591c8b1b188cc48d..92654dc5a51b58362d271bd6773f7ce506acfc98 100644 (file)
@@ -745,8 +745,10 @@ TokenStream::visit (PathIdentSegment &segment)
 void
 TokenStream::visit (QualifiedPathInExpression &path)
 {
+  visit (path.get_qualified_path_type ());
   for (auto &segment : path.get_segments ())
     {
+      tokens.push_back (Rust::Token::make (SCOPE_RESOLUTION, Location ()));
       visit (segment);
     }
 }