aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2024-12-04 15:10:10 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-21 12:33:12 +0100
commit081828243086965b3882489ffc36216c1d7b3cb0 (patch)
tree053471c9eaa551d7689986fe8bbb92df999e5ef0
parentc482c358e3a724c8e258a3fc58230b931dd64747 (diff)
downloadgcc-081828243086965b3882489ffc36216c1d7b3cb0.zip
gcc-081828243086965b3882489ffc36216c1d7b3cb0.tar.gz
gcc-081828243086965b3882489ffc36216c1d7b3cb0.tar.bz2
gccrs: derive(Copy): Use new LangItemPath
gcc/rust/ChangeLog: * expand/rust-derive-copy.cc: Use new LangItemPath for derive(Copy).
-rw-r--r--gcc/rust/expand/rust-derive-copy.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/expand/rust-derive-copy.cc b/gcc/rust/expand/rust-derive-copy.cc
index 1de7290..0281725 100644
--- a/gcc/rust/expand/rust-derive-copy.cc
+++ b/gcc/rust/expand/rust-derive-copy.cc
@@ -18,6 +18,8 @@
#include "rust-derive-copy.h"
#include "rust-ast-full.h"
+#include "rust-mapping-common.h"
+#include "rust-path.h"
namespace Rust {
namespace AST {
@@ -44,7 +46,7 @@ DeriveCopy::copy_impl (
// `$crate::core::marker::Copy` instead
auto segments = std::vector<std::unique_ptr<TypePathSegment>> ();
segments.emplace_back (builder.type_path_segment ("Copy"));
- auto copy = TypePath (std::move (segments), loc);
+ auto copy = Rust::make_unique<LangItemPath> (LangItem::Kind::COPY, loc);
// we need to build up the generics for this impl block which will be just a
// clone of the types specified ones
@@ -116,7 +118,7 @@ DeriveCopy::copy_impl (
: builder.single_generic_type_path (name, generic_args_for_self);
return std::unique_ptr<Item> (
- new TraitImpl (copy, /* unsafe */ false,
+ new TraitImpl (std::move (copy), /* unsafe */ false,
/* exclam */ false, /* trait items */ {},
std::move (impl_generics), std::move (self_type_path),
WhereClause::create_empty (), Visibility::create_private (),