gccrs: ast: Dump tuple type
authorJakub Dupak <dev@jakubdupak.com>
Sun, 6 Nov 2022 20:27:49 +0000 (21:27 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 21 Feb 2023 11:36:47 +0000 (12:36 +0100)
gcc/rust/ChangeLog:

* ast/rust-ast-dump.cc (Dump::visit): Add missing tuple type visitor.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
gcc/rust/ast/rust-ast-dump.cc

index 3af4895..9393f95 100644 (file)
@@ -1580,16 +1580,24 @@ Dump::visit (TraitObjectTypeOneBound &)
 {}
 
 void
-Dump::visit (TupleType &)
-{}
+Dump::visit (TupleType &type)
+{
+  // Syntax:
+  //   ( )
+  //   | ( ( Type , )+ Type? )
+
+  stream << '(';
+  visit_items_joined_by_separator (type.get_elems (), ", ");
+  stream << ')';
+}
 
 void
 Dump::visit (NeverType &)
 {
-    // Syntax:
-    //  !
+  // Syntax:
+  //  !
 
-    stream << '!';
+  stream << '!';
 }
 
 void