public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] ast: Dump TraitImpl items
@ 2022-06-14 14:25 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-14 14:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:88db3982bc2c38111077fe0adc93d8451bad2ca1

commit 88db3982bc2c38111077fe0adc93d8451bad2ca1
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date:   Thu Jun 2 18:59:25 2022 +0200

    ast: Dump TraitImpl items

Diff:
---
 gcc/rust/ast/rust-ast-dump.cc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index cdcb5632cc7..d1105c95073 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -624,7 +624,21 @@ Dump::visit (InherentImpl &impl)
 
 void
 Dump::visit (TraitImpl &impl)
-{}
+{
+  stream << "impl ";
+  impl.get_trait_path ().accept_vis (*this);
+  stream << " for ";
+  impl.get_type ()->accept_vis (*this);
+
+  stream << " {\n";
+  indentation.increment ();
+
+  for (auto &item : impl.get_impl_items ())
+    item->accept_vis (*this);
+
+  indentation.decrement ();
+  stream << "\n}\n";
+}
 
 void
 Dump::visit (ExternalStaticItem &item)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-14 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 14:25 [gcc/devel/rust/master] ast: Dump TraitImpl items Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).