From: Pierre-Emmanuel Patry Date: Fri, 25 Apr 2025 14:02:12 +0000 (+0200) Subject: gccrs: Completely duplicate path node X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dc351dac40989afbc0601e5156017528aa905837;p=thirdparty%2Fgcc.git gccrs: Completely duplicate path node 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 --- diff --git a/gcc/rust/expand/rust-derive-clone.cc b/gcc/rust/expand/rust-derive-clone.cc index a955b581acd..321fa00d2ec 100644 --- a/gcc/rust/expand/rust-derive-clone.cc +++ b/gcc/rust/expand/rust-derive-clone.cc @@ -293,8 +293,14 @@ DeriveClone::clone_enum_struct (PathInExpression variant_path, new ReferencePattern (std::unique_ptr (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 ( - 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)); } diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude index fac66a7de2c..c020e36fba4 100644 --- a/gcc/testsuite/rust/compile/nr2/exclude +++ b/gcc/testsuite/rust/compile/nr2/exclude @@ -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