]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: collector: Add generics to external functions
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 28 Jun 2023 12:52:31 +0000 (14:52 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:49:33 +0000 (18:49 +0100)
Add generic to external functiond declaration collector output.

gcc/rust/ChangeLog:

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

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

index 84ebcad749ae141181a35136a5e1ca09928bc71a..fedff55ee15f4838f85499244deb4039e110b384 100644 (file)
@@ -2192,6 +2192,8 @@ TokenCollector::visit (ExternalFunctionItem &function)
 
   push (Rust::Token::make (FN_TOK, function.get_locus ()));
   push (Rust::Token::make_identifier (Location (), std::move (id)));
+  if (function.has_generics ())
+    visit (function.get_generic_params ());
   push (Rust::Token::make (LEFT_PAREN, Location ()));
 
   visit_items_joined_by_separator (function.get_function_params ());