aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-06-28 13:10:57 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:49:33 +0100
commit1083826a89e22c736a80ed93ba9c10c426cff59d (patch)
treec66490517758c36471a5256c4aac63adc573fbab /gcc
parent005e4febac01b9e92465e17bc4847e7ef955f0dc (diff)
downloadgcc-1083826a89e22c736a80ed93ba9c10c426cff59d.zip
gcc-1083826a89e22c736a80ed93ba9c10c426cff59d.tar.gz
gcc-1083826a89e22c736a80ed93ba9c10c426cff59d.tar.bz2
gccrs: collector: Fix trait impl block
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast-collector.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc
index eb34ceb..8fc0f3d 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -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 ());