]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: collector: Add where clause to trait impl block
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 28 Jun 2023 13:25:06 +0000 (15:25 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:34 +0000 (18:49 +0100)
Trait impl block were missing a where clause for their output.

gcc/rust/ChangeLog:

* ast/rust-ast-collector.cc (TokenCollector::visit): Add where
clause.

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

index 92411ab101a37a8babefad65745b610006c56802..7730746a11c8d5d438462ce20f44ae6003224dd3 100644 (file)
@@ -2151,6 +2151,10 @@ TokenCollector::visit (TraitImpl &impl)
   visit (impl.get_trait_path ());
   push (Rust::Token::make (FOR, Location ()));
   visit (impl.get_type ());
+
+  if (impl.has_where_clause ())
+    visit (impl.get_where_clause ());
+
   visit_items_as_block (impl.get_impl_items ());
 }