]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Completely duplicate path node
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Fri, 25 Apr 2025 14:02:12 +0000 (16:02 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Mon, 28 Apr 2025 11:08:30 +0000 (11:08 +0000)
Both nodes had the same id, this led to a resolution conflict.

gcc/rust/ChangeLog:

* expand/rust-derive-clone.cc (DeriveClone::clone_enum_struct): Clone
path to avoid using the same nodeid.

gcc/testsuite/ChangeLog:

* rust/compile/nr2/exclude: Remove now passing test from exclusion
list.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/expand/rust-derive-clone.cc
gcc/testsuite/rust/compile/nr2/exclude

index ca5ef0e69a93d2da2b05e555fe7f1035585a3306..b47c21df6ab089ddf3fe74ce28635b8cc1c9bcd0 100644 (file)
@@ -293,8 +293,14 @@ DeriveClone::clone_enum_struct (PathInExpression variant_path,
     new ReferencePattern (std::unique_ptr<Pattern> (new StructPattern (
                            variant_path, loc, pattern_elts)),
                          false, false, loc));
+
+  PathInExpression new_path (variant_path.get_segments (),
+                            variant_path.get_outer_attrs (),
+                            variant_path.get_locus (),
+                            variant_path.opening_scope_resolution ());
+
   auto expr = std::unique_ptr<Expr> (
-    new StructExprStructFields (variant_path, std::move (cloned_fields), loc));
+    new StructExprStructFields (new_path, std::move (cloned_fields), loc));
 
   return builder.match_case (std::move (pattern), std::move (expr));
 }
index fac66a7de2c1ebf21d0a75a1af68965e10004480..c020e36fba4ae3f7f723f94bfcf6754d6049aaa2 100644 (file)
@@ -6,7 +6,6 @@ pub_restricted_1.rs
 pub_restricted_2.rs
 pub_restricted_3.rs
 issue-2905-2.rs
-derive_clone_enum3.rs
 derive-default1.rs
 derive-eq-invalid.rs
 torture/alt_patterns1.rs