From 1a0ec0ec4c8045772603f667abd306266f824ea2 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 26 Dec 2024 22:09:11 +0000 Subject: derive(Copy): Use copy lang item when deriving Copy. gcc/rust/ChangeLog: * expand/rust-derive-copy.cc: Use lang item path. --- gcc/rust/expand/rust-derive-copy.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gcc/rust/expand') 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> &type_generics) { - // `$crate::core::marker::Copy` instead - auto segments = std::vector> (); - 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 -- cgit v1.1