Skip to content

Commit 214a5f0

Browse files
committed
Use full paths in macros
1 parent b1a7f91 commit 214a5f0

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/macros.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ macro_rules! s {
106106
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
107107
__item! {
108108
#[repr(C)]
109-
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
110-
#[derive(Copy, Clone)]
109+
#[cfg_attr(
110+
feature = "extra_traits",
111+
core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
112+
)]
113+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
111114
#[allow(deprecated)]
112115
$(#[$attr])*
113116
pub struct $i { $($field)* }
@@ -125,8 +128,11 @@ macro_rules! s_paren {
125128
pub struct $i:ident ( $($field:tt)* );
126129
)*) => ($(
127130
__item! {
128-
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
129-
#[derive(Copy, Clone)]
131+
#[cfg_attr(
132+
feature = "extra_traits",
133+
core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
134+
)]
135+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
130136
$(#[$attr])*
131137
pub struct $i ( $($field)* );
132138
}
@@ -147,7 +153,7 @@ macro_rules! s_no_extra_traits {
147153
(it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => (
148154
__item! {
149155
#[repr(C)]
150-
#[derive(Copy, Clone)]
156+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
151157
$(#[$attr])*
152158
pub union $i { $($field)* }
153159
}
@@ -156,7 +162,7 @@ macro_rules! s_no_extra_traits {
156162
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
157163
__item! {
158164
#[repr(C)]
159-
#[derive(Copy, Clone)]
165+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
160166
$(#[$attr])*
161167
pub struct $i { $($field)* }
162168
}
@@ -184,8 +190,11 @@ macro_rules! e {
184190
pub enum $i:ident { $($field:tt)* }
185191
)*) => ($(
186192
__item! {
187-
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
188-
#[derive(Copy, Clone)]
193+
#[cfg_attr(
194+
feature = "extra_traits",
195+
core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
196+
)]
197+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
189198
$(#[$attr])*
190199
pub enum $i { $($field)* }
191200
}

0 commit comments

Comments
 (0)