]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ast-collector: Fix tuple struct pattern collection
authorArthur Cohen <arthur.cohen@embecosm.com>
Fri, 3 Jan 2025 14:28:07 +0000 (14:28 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Thu, 16 Jan 2025 14:00:31 +0000 (14:00 +0000)
gcc/rust/ChangeLog:

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

gcc/rust/ast/rust-ast-collector.cc

index 32e021c4d3b4d4485a40069b3c98992920f735bb..a3c54198358b9db3320d1d154a663f05e6e7e42b 100644 (file)
@@ -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