From 214a5f0d2e1dfb17d72a081d5118d86d034a09d4 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 27 Nov 2024 17:10:52 -0500 Subject: [PATCH] Use full paths in macros --- src/macros.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 86f3a5144f22..b2a0a085a6a0 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -106,8 +106,11 @@ macro_rules! s { (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( __item! { #[repr(C)] - #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] - #[derive(Copy, Clone)] + #[cfg_attr( + feature = "extra_traits", + core::prelude::v1::derive(Debug, Eq, Hash, PartialEq) + )] + #[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)] #[allow(deprecated)] $(#[$attr])* pub struct $i { $($field)* } @@ -125,8 +128,11 @@ macro_rules! s_paren { pub struct $i:ident ( $($field:tt)* ); )*) => ($( __item! { - #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] - #[derive(Copy, Clone)] + #[cfg_attr( + feature = "extra_traits", + core::prelude::v1::derive(Debug, Eq, Hash, PartialEq) + )] + #[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)] $(#[$attr])* pub struct $i ( $($field)* ); } @@ -147,7 +153,7 @@ macro_rules! s_no_extra_traits { (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => ( __item! { #[repr(C)] - #[derive(Copy, Clone)] + #[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)] $(#[$attr])* pub union $i { $($field)* } } @@ -156,7 +162,7 @@ macro_rules! s_no_extra_traits { (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( __item! { #[repr(C)] - #[derive(Copy, Clone)] + #[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)] $(#[$attr])* pub struct $i { $($field)* } } @@ -184,8 +190,11 @@ macro_rules! e { pub enum $i:ident { $($field:tt)* } )*) => ($( __item! { - #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] - #[derive(Copy, Clone)] + #[cfg_attr( + feature = "extra_traits", + core::prelude::v1::derive(Debug, Eq, Hash, PartialEq) + )] + #[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)] $(#[$attr])* pub enum $i { $($field)* } }