]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: collector: Fix trait impl block
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 28 Jun 2023 11:10:57 +0000 (13:10 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:33 +0000 (18:49 +0100)
Trait impl block did not output any generic declaration nor the trait
excalamation mark.

gcc/rust/ChangeLog:

* ast/rust-ast-collector.cc (TokenCollector::visit): Fix trait
impl block output.

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

index eb34ceb98a8c9cb76bc739aafeae13434e90562c..8fc0f3dcc8df43d78d98f31fc685ceb11ae8ca81 100644 (file)
@@ -2144,6 +2144,9 @@ TokenCollector::visit (TraitImpl &impl)
 {
   visit_items_as_lines (impl.get_outer_attrs ());
   push (Rust::Token::make (IMPL, impl.get_locus ()));
+  visit (impl.get_generic_params ());
+  if (impl.is_exclam ())
+    push (Rust::Token::make (EXCLAM, Location ()));
   visit (impl.get_trait_path ());
   push (Rust::Token::make (FOR, Location ()));
   visit (impl.get_type ());