aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2024-12-26 22:09:11 +0000
committerCohenArthur <arthur.cohen@embecosm.com>2025-01-20 12:09:26 +0000
commit1a0ec0ec4c8045772603f667abd306266f824ea2 (patch)
tree6ac08b85fdcd4f6cbfe8cbca5f95b1f6c36b8859 /gcc/rust/expand
parent533abf7e53c6edb699d67418a84b662bd41cf381 (diff)
downloadgcc-1a0ec0ec4c8045772603f667abd306266f824ea2.zip
gcc-1a0ec0ec4c8045772603f667abd306266f824ea2.tar.gz
gcc-1a0ec0ec4c8045772603f667abd306266f824ea2.tar.bz2
derive(Copy): Use copy lang item when deriving Copy.
gcc/rust/ChangeLog: * expand/rust-derive-copy.cc: Use lang item path.
Diffstat (limited to 'gcc/rust/expand')
-rw-r--r--gcc/rust/expand/rust-derive-copy.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/rust/expand/rust-derive-copy.cc b/gcc/rust/expand/rust-derive-copy.cc
index 358a52e..1f52a08e 100644
--- a/gcc/rust/expand/rust-derive-copy.cc
+++ b/gcc/rust/expand/rust-derive-copy.cc
@@ -18,6 +18,7 @@
#include "rust-derive-copy.h"
#include "rust-ast-full.h"
+#include "rust-hir-map.h"
#include "rust-mapping-common.h"
#include "rust-path.h"
@@ -43,12 +44,7 @@ DeriveCopy::copy_impl (
std::string name,
const std::vector<std::unique_ptr<GenericParam>> &type_generics)
{
- // `$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 = TypePath (LangItem::Kind::COPY, loc);
+ auto copy = builder.type_path (LangItem::Kind::COPY);
// we need to build up the generics for this impl block which will be just a
// clone of the types specified ones