]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
derive(Clone): Use lang item for PhantomData in Clone
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 26 Dec 2024 23:01:32 +0000 (23:01 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 20 Jan 2025 12:09:26 +0000 (12:09 +0000)
gcc/rust/ChangeLog:

* expand/rust-derive-clone.cc (DeriveClone::visit_union): Create a lang item path
instead of a regular path.

gcc/rust/expand/rust-derive-clone.cc

index eeffb009b953536cc46f3121d94d3ee767a21408..aefc64cf97e9bfdf1fd887aa40409bb183796e66 100644 (file)
@@ -263,7 +263,7 @@ DeriveClone::visit_union (Union &item)
     {StructField (
       Identifier ("_t"),
       builder.single_generic_type_path (
-       "PhantomData",
+       LangItem::Kind::PHANTOM_DATA,
        GenericArgs (
          {}, {GenericArg::create_type (builder.single_type_path ("T"))}, {})),
       Visibility::create_private (), item.get_locus ())});