]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Improve HIR dumps for patterns
authorZhi Heng <yapzhhg@gmail.com>
Sun, 15 Jun 2025 07:07:54 +0000 (15:07 +0800)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:48 +0000 (16:36 +0200)
gcc/rust/ChangeLog:

* hir/rust-hir-dump.cc: Change pattern dumps to use visit_field.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
gcc/rust/hir/rust-hir-dump.cc

index 38079c76f9a9a7e40ad3cd3872768e3a148957ab..098b3c1e26609c72742ae70953d2f4df44f04733 100644 (file)
@@ -2196,7 +2196,7 @@ Dump::visit (StructPatternFieldIdentPat &e)
   auto oa = e.get_outer_attrs ();
   do_outer_attrs (oa);
   put_field ("ident", e.get_identifier ().as_string ());
-  put_field ("ident_pattern", e.get_pattern ().as_string ());
+  visit_field ("ident_pattern", e.get_pattern ());
   end ("StructPatternFieldIdentPat");
 }
 
@@ -2314,7 +2314,7 @@ Dump::visit (LetStmt &e)
   auto oa = e.get_outer_attrs ();
   do_outer_attrs (oa);
 
-  put_field ("variable_pattern", e.get_pattern ().as_string ());
+  visit_field ("variable_pattern", e.get_pattern ());
 
   if (e.has_type ())
     visit_field ("type", e.get_type ());