[committed,036/103] gccrs: dump: Fix module dumping

Message ID 20230221120230.596966-37-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:01 p.m. UTC
  From: Arthur Cohen <arthur.cohen@embecosm.com>

gcc/rust/ChangeLog:

	* ast/rust-ast-dump.cc (Dump::visit): Fix formatting when dumping modules.
---
 gcc/rust/ast/rust-ast-dump.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index 653c1d9ff03..1e7a235932d 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -810,11 +810,10 @@  Dump::visit (Method &method)
 void
 Dump::visit (Module &module)
 {
-  indentation.increment ();
-
-  stream << indentation;
   emit_visibility (module.get_visibility ());
-  stream << "mod" << module.get_name () << " {\n";
+  stream << "mod " << module.get_name () << " {\n";
+
+  indentation.increment ();
 
   for (auto &item : module.get_items ())
     {
@@ -824,6 +823,7 @@  Dump::visit (Module &module)
     }
 
   indentation.decrement ();
+
   stream << indentation << "}\n";
 }