aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Dupak <dev@jakubdupak.com>2022-11-15 15:49:05 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:48 +0100
commit7ed4a0ebc1d1cad10dc879e5ad8ac0fa0f647e9f (patch)
tree651368f86eb4a75d431d3c4a85397a2ffbc8f6f2
parent638f65b20832751c8f32e7bac8411fb7cd2ac60f (diff)
downloadgcc-7ed4a0ebc1d1cad10dc879e5ad8ac0fa0f647e9f.zip
gcc-7ed4a0ebc1d1cad10dc879e5ad8ac0fa0f647e9f.tar.gz
gcc-7ed4a0ebc1d1cad10dc879e5ad8ac0fa0f647e9f.tar.bz2
gccrs: ast: Dump trait object type
gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add missing visitor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
-rw-r--r--gcc/rust/ast/rust-ast-dump.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index 1d593d4..0ae57fd 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -1618,12 +1618,21 @@ Dump::visit (ImplTraitType &type)
// TypeParamBound ( + TypeParamBound )* +?
stream << "impl ";
- visit_items_joined_by_separator(type.get_type_param_bounds (), " + ");
+ visit_items_joined_by_separator (type.get_type_param_bounds (), " + ");
}
void
-Dump::visit (TraitObjectType &)
-{}
+Dump::visit (TraitObjectType &type)
+{
+ // Syntax:
+ // dyn? TypeParamBounds
+ // TypeParamBounds :
+ // TypeParamBound ( + TypeParamBound )* +?
+
+ if (type.is_dyn ())
+ stream << "dyn ";
+ visit_items_joined_by_separator (type.get_type_param_bounds (), " + ");
+}
void
Dump::visit (ParenthesisedType &)
@@ -1636,7 +1645,7 @@ Dump::visit (ImplTraitTypeOneBound &type)
// impl TraitBound
stream << "impl ";
- visit (type.get_trait_bound());
+ visit (type.get_trait_bound ());
}
void