[committed,075/103] gccrs: ast: Dump array type

Message ID 20230221120230.596966-76-arthur.cohen@embecosm.com
State Unresolved
Headers
Series [committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Arthur Cohen Feb. 21, 2023, 12:02 p.m. UTC
  From: Jakub Dupak <dev@jakubdupak.com>

gcc/rust/ChangeLog:

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

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/ast/rust-ast-dump.cc | 7 +++++++
 1 file changed, 7 insertions(+)
  

Patch

diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index b017c6ea592..9f73d0565ac 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -1600,7 +1600,14 @@  Dump::visit (ReferenceType &type)
 void
 Dump::visit (ArrayType &type)
 {
+  // Syntax:
+  //    [ Type ; Expression ]
+
+  stream << '[';
   visit (type.get_elem_type ());
+  stream << "; ";
+  visit(type.get_size_expr());
+  stream << ']';
 }
 
 void