Skip to content

Commit 233684f

Browse files
committed
Use full paths in macros
1 parent cd04ec8 commit 233684f

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/macros.rs

+17-8
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ macro_rules! s {
108108
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
109109
__item! {
110110
#[repr(C)]
111-
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
112-
#[derive(Copy, Clone)]
111+
#[cfg_attr(
112+
feature = "extra_traits",
113+
core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
114+
)]
115+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
113116
#[allow(deprecated)]
114117
$(#[$attr])*
115118
pub struct $i { $($field)* }
@@ -127,8 +130,11 @@ macro_rules! s_paren {
127130
pub struct $i:ident ( $($field:tt)* );
128131
)*) => ($(
129132
__item! {
130-
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
131-
#[derive(Copy, Clone)]
133+
#[cfg_attr(
134+
feature = "extra_traits",
135+
core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
136+
)]
137+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
132138
$(#[$attr])*
133139
pub struct $i ( $($field)* );
134140
}
@@ -149,7 +155,7 @@ macro_rules! s_no_extra_traits {
149155
(it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => (
150156
__item! {
151157
#[repr(C)]
152-
#[derive(Copy, Clone)]
158+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
153159
$(#[$attr])*
154160
pub union $i { $($field)* }
155161
}
@@ -158,7 +164,7 @@ macro_rules! s_no_extra_traits {
158164
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
159165
__item! {
160166
#[repr(C)]
161-
#[derive(Copy, Clone)]
167+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
162168
$(#[$attr])*
163169
pub struct $i { $($field)* }
164170
}
@@ -186,8 +192,11 @@ macro_rules! e {
186192
pub enum $i:ident { $($field:tt)* }
187193
)*) => ($(
188194
__item! {
189-
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
190-
#[derive(Copy, Clone)]
195+
#[cfg_attr(
196+
feature = "extra_traits",
197+
core::prelude::v1::derive(Debug, Eq, Hash, PartialEq)
198+
)]
199+
#[core::prelude::v1::derive(core::clone::Clone, core::marker::Copy)]
191200
$(#[$attr])*
192201
pub enum $i { $($field)* }
193202
}

0 commit comments

Comments
 (0)