Skip to content

Commit

Permalink
Use full paths in macros
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Nov 27, 2024
1 parent b1a7f91 commit 214a5f0
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)* }
Expand All @@ -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)* );
}
Expand All @@ -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)* }
}
Expand All @@ -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)* }
}
Expand Down Expand Up @@ -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)* }
}
Expand Down

0 comments on commit 214a5f0

Please sign in to comment.