aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-06-14 12:29:33 +0000
committerGitHub <noreply@github.com>2022-06-14 12:29:33 +0000
commit61e95a9bf6d4e8cc4de7b2d2b4c1ac989fa76836 (patch)
treeba05ce52f9288593f1190792d9a66d98a905c108
parent1c679d7f42834a72956d6fb39c8d298dd6dc4b4e (diff)
parent88db3982bc2c38111077fe0adc93d8451bad2ca1 (diff)
downloadgcc-61e95a9bf6d4e8cc4de7b2d2b4c1ac989fa76836.zip
gcc-61e95a9bf6d4e8cc4de7b2d2b4c1ac989fa76836.tar.gz
gcc-61e95a9bf6d4e8cc4de7b2d2b4c1ac989fa76836.tar.bz2
Merge #1296
1296: Ast dump trait impl r=CohenArthur a=CohenArthur Needs #1295 This adds the dumping of trait implementations for types. However, it is incomplete as I don't believe we can yet handle associated types and associated constants properly? Am I looking in the wrong place? Will dig deeper, but opening for any early review. Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
-rw-r--r--gcc/rust/ast/rust-ast-dump.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index cdcb563..d1105c9 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)