https://gcc.gnu.org/g:aacecbae35bec0f9fbbc53f9db1c46fa6ba70ecc

commit aacecbae35bec0f9fbbc53f9db1c46fa6ba70ecc
Author: Arthur Cohen <arthur.co...@embecosm.com>
Date:   Fri Jan 3 14:28:07 2025 +0000

    ast-collector: Fix tuple struct pattern collection
    
    gcc/rust/ChangeLog:
    
            * ast/rust-ast-collector.cc (TokenCollector::visit): Visit tuple 
pattern items as
            separated by commas.

Diff:
---
 gcc/rust/ast/rust-ast-collector.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/rust/ast/rust-ast-collector.cc 
b/gcc/rust/ast/rust-ast-collector.cc
index 32e021c4d3b4..a3c54198358b 100644
--- a/gcc/rust/ast/rust-ast-collector.cc
+++ b/gcc/rust/ast/rust-ast-collector.cc
@@ -2470,10 +2470,7 @@ TokenCollector::visit (StructPattern &pattern)
 void
 TokenCollector::visit (TupleStructItemsNoRange &pattern)
 {
-  for (auto &pat : pattern.get_patterns ())
-    {
-      visit (pat);
-    }
+  visit_items_joined_by_separator (pattern.get_patterns ());
 }
 
 void

Reply via email to