#![deny(warnings)]
#![doc(test(attr(deny(warnings))))]
#![doc(test(attr(allow(dead_code))))]
#![doc(test(attr(allow(unused_variables))))]
#![doc(test(attr(allow(unused_macros))))]
#![no_std]
#[doc(hidden)]
pub use core::fmt::Binary as std_fmt_Binary;
#[doc(hidden)]
pub use core::fmt::Debug as std_fmt_Debug;
#[doc(hidden)]
pub use core::fmt::Display as std_fmt_Display;
#[doc(hidden)]
pub use core::fmt::Formatter as std_fmt_Formatter;
#[doc(hidden)]
pub use core::fmt::LowerExp as std_fmt_LowerExp;
#[doc(hidden)]
pub use core::fmt::LowerHex as std_fmt_LowerHex;
#[doc(hidden)]
pub use core::fmt::Octal as std_fmt_Octal;
#[doc(hidden)]
pub use core::fmt::Pointer as std_fmt_Pointer;
#[doc(hidden)]
pub use core::fmt::UpperExp as std_fmt_UpperExp;
#[doc(hidden)]
pub use core::fmt::UpperHex as std_fmt_UpperHex;
#[doc(hidden)]
pub use core::fmt::Result as std_fmt_Result;
#[doc(hidden)]
pub use core::ops::Add as std_ops_Add;
#[doc(hidden)]
pub use core::ops::BitAnd as std_ops_BitAnd;
#[doc(hidden)]
pub use core::ops::BitOr as std_ops_BitOr;
#[doc(hidden)]
pub use core::ops::BitXor as std_ops_BitXor;
#[doc(hidden)]
pub use core::ops::Deref as std_ops_Deref;
#[doc(hidden)]
pub use core::ops::DerefMut as std_ops_DerefMut;
#[doc(hidden)]
pub use core::ops::Div as std_ops_Div;
#[doc(hidden)]
pub use core::ops::Index as std_ops_Index;
#[doc(hidden)]
pub use core::ops::IndexMut as std_ops_IndexMut;
#[doc(hidden)]
pub use core::ops::Mul as std_ops_Mul;
#[doc(hidden)]
pub use core::ops::Neg as std_ops_Neg;
#[doc(hidden)]
pub use core::ops::Not as std_ops_Not;
#[doc(hidden)]
pub use core::ops::Rem as std_ops_Rem;
#[doc(hidden)]
pub use core::ops::Shl as std_ops_Shl;
#[doc(hidden)]
pub use core::ops::Shr as std_ops_Shr;
#[doc(hidden)]
pub use core::ops::Sub as std_ops_Sub;
#[doc(hidden)]
pub use generics::concat as generics_concat;
#[doc(hidden)]
pub use generics::parse as generics_parse;
#[doc(hidden)]
#[macro_export]
macro_rules! as_item {
($i:item) => {$i};
}
#[doc(hidden)]
#[macro_export]
macro_rules! wrap_bin_op {
(
trait: ($($tr:tt)*)::$meth:ident,
kind: simple,
item: [$name:ident] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_bin_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: simple,
item: [$name] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple,
item: [$name:ident] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_bin_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: simple,
item: [$name] [$t0] [$([$phantom])*]
]
}
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple,
item: [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)*<$name $($r)*> for $name $($r)* $($w)* {
type Output = Self;
fn $meth(self, rhs: Self) -> Self {
$name(
<$t0 as $($tr)*<$t0>>::$meth(self.0, rhs.0)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
(
trait: ($($tr:tt)*)::$meth:ident,
kind: simple_ref,
item: [$a:lifetime] [$name:ident] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_bin_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: simple_ref,
item: [$a] [$name] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple_ref,
item: [$a:lifetime] [$name:ident] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_bin_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: simple_ref,
item: [$a] [$name] [$t0] [$([$phantom])*]
]
}
[ < $a > ] [] [],
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple_ref,
item: [$a:lifetime] [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)*<$name $($r)*> for & $a $name $($r)* $($w)* {
type Output = $name $($r)*;
fn $meth(self, rhs: $name $($r)*) -> $name $($r)* {
$name(
<$t0 as $($tr)*<$t0>>::$meth(self.0, rhs.0)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
(
trait: ($($tr:tt)*)::$meth:ident,
kind: rhs_rewrap(&Self),
item: [$a:lifetime] [$name:ident] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_bin_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: rhs_rewrap(&Self),
item: [$a] [$name] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: rhs_rewrap(&Self),
item: [$a:lifetime] [$name:ident] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_bin_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: rhs_rewrap(&Self),
item: [$a] [$name] [$t0] [$([$phantom])*]
]
}
[ < $a > ] [] [],
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: rhs_rewrap(&Self),
item: [$a:lifetime] [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)*<& $a $name $($r)*> for $name $($r)* $($w)* {
type Output = Self;
fn $meth(self, rhs: & $a Self) -> Self {
$name(
<$t0 as $($tr)*<$t0>>::$meth(self.0, rhs.0)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
(
trait: ($($tr:tt)*)::$meth:ident,
kind: rhs_rewrap($Rhs:ty),
item: [$name:ident] [$($lt:tt)*] [$($T:tt)*] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_bin_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: rhs_rewrap($Rhs),
item: [$name] [$($lt)*] [$($T)*] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: rhs_rewrap($Rhs:ty),
item: [$name:ident] [$($lt:tt)*] [$($T:tt)*] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_bin_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: rhs_rewrap($Rhs),
item: [$name] [$t0] [$([$phantom])*]
]
}
[$($lt)*] [] [],
[$($g)*] [$($r)*] [$($w)*],
[$($T)*] [] [],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: rhs_rewrap($Rhs:ty),
item: [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)*<$Rhs> for $name $($r)* $($w)* {
type Output = Self;
fn $meth(self, rhs: $Rhs) -> Self {
$name(
<$t0 as $($tr)*<$Rhs>>::$meth(self.0, rhs)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
(
trait: ($($tr:tt)*)::$meth:ident,
kind: ref_rhs_rewrap(&Self),
item: [$a:lifetime] [$b:lifetime] [$name:ident] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_bin_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: ref_rhs_rewrap(&Self),
item: [$a] [$b] [$name] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: ref_rhs_rewrap(&Self),
item: [$a:lifetime] [$b:lifetime] [$name:ident] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_bin_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: ref_rhs_rewrap(&Self),
item: [$a] [$b] [$name] [$t0] [$([$phantom])*]
]
}
[ < $a, $b > ] [] [],
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: ref_rhs_rewrap(&Self),
item: [$a:lifetime] [$b:lifetime] [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)*<& $b $name $($r)*> for & $a $name $($r)* $($w)* {
type Output = $name $($r)*;
fn $meth(self, rhs: & $b $name $($r)*) -> $name $($r)* {
$name(
<$t0 as $($tr)*<$t0>>::$meth(self.0, rhs.0)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
(
trait: ($($tr:tt)*)::$meth:ident,
kind: ref_rhs_rewrap($Rhs:ty),
item: [$a:lifetime] [$name:ident] [$($lt:tt)*] [$($T:tt)*] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_bin_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: ref_rhs_rewrap($Rhs),
item: [$a] [$name] [$($lt)*] [$($T)*] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: ref_rhs_rewrap($Rhs:ty),
item: [$a:lifetime] [$name:ident] [$($lt:tt)*] [$($T:tt)*] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_bin_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: ref_rhs_rewrap($Rhs),
item: [$a] [$name] [$t0] [$([$phantom])*]
]
}
[ < $a > ] [] [],
[$($lt)*] [] [],
[$($g)*] [$($r)*] [$($w)*],
[$($T)*] [] [],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: ref_rhs_rewrap($Rhs:ty),
item: [$a:lifetime] [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)*<$Rhs> for & $a $name $($r)* $($w)* {
type Output = $name $($r)*;
fn $meth(self, rhs: $Rhs) -> $name $($r)* {
$name(
<$t0 as $($tr)*<$Rhs>>::$meth(self.0, rhs)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
}
#[macro_export]
macro_rules! NewtypeAdd {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeAdd! { () $vis struct $name $($body)+ }
$crate::NewtypeAdd! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeAdd! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeAdd! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeAdd! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeAdd! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeAdd! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeAdd! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Add)::add, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeBitAnd {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeBitAnd! { () $vis struct $name $($body)+ }
$crate::NewtypeBitAnd! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeBitAnd! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeBitAnd! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeBitAnd! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitAnd! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitAnd! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitAnd! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitAnd)::bitand, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeBitOr {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeBitOr! { () $vis struct $name $($body)+ }
$crate::NewtypeBitOr! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeBitOr! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeBitOr! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeBitOr! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitOr! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitOr! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitOr! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitOr)::bitor, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeBitXor {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeBitXor! { () $vis struct $name $($body)+ }
$crate::NewtypeBitXor! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeBitXor! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeBitXor! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeBitXor! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitXor! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitXor! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeBitXor! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_BitXor)::bitxor, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeDiv {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeDiv! { () $vis struct $name $($body)+ }
$crate::NewtypeDiv! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeDiv! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeDiv! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeDiv! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeDiv! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeDiv! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeDiv! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Div)::div, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeMul {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeMul! { () $vis struct $name $($body)+ }
$crate::NewtypeMul! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeMul! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeMul! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeMul! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeMul! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeMul! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeMul! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Mul)::mul, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeRem {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeRem! { () $vis struct $name $($body)+ }
$crate::NewtypeRem! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeRem! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeRem! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeRem! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeRem! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeRem! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeRem! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Rem)::rem, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeSub {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeSub! { () $vis struct $name $($body)+ }
$crate::NewtypeSub! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeSub! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeSub! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeSub! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeSub! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeSub! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeSub! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Sub)::sub, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeShl {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeShl! { () $vis struct $name $($body)+ }
$crate::NewtypeShl! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeShl! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeShl! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeShl! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeShl! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeShl! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeShl! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shl)::shl, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeShr {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeShr! { () $vis struct $name $($body)+ }
$crate::NewtypeShr! { (&self) $vis struct $name $($body)+ }
$crate::NewtypeShr! { (&Self) $vis struct $name $($body)+ }
$crate::NewtypeShr! { (&self, &Self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeShr! { (where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeShr! { ((&self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeShr! { ((&Self) where $($bound)*) $vis struct $name $($body)+ }
$crate::NewtypeShr! { ((&self, &Self) where $($bound)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: simple_ref, item: [$a] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: simple_ref, item: [$a] [$name] [$($bound)*] [$($body)+] }
};
((&self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, &Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [] [$($body)+] }
};
((&self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [] [$($body)+] }
};
((& $a:lifetime self, & $b:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [] [$($body)+] }
};
(((&self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, &Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: [$a] ['newtype_derive_b] [$name] [$($bound)*] [$($body)+] }
};
(((&self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: ['newtype_derive_a] [$b] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, & $b:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap(&Self), item: [$a] [$b] [$name] [$($bound)*] [$($body)+] }
};
((&self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [] [$($body)+] }
};
((& $a:lifetime self, $Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [] [$($body)+] }
};
(((&self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime self, $Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(&self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: ['newtype_derive] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>(& $a:lifetime self, $Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: ref_rhs_rewrap($Rhs), item: [$a] [$name] [] [ $( < $($T),+ > )? ] [] [$($body)+] }
};
((&Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [] [$($body)+] }
};
((& $a:lifetime Self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap(&Self), item: [$a] [$name] [] [$($body)+] }
};
(((&Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap(&Self), item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
(((& $a:lifetime Self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap(&Self), item: [$a] [$name] [$($bound)*] [$($body)+] }
};
(($Rhs:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap($Rhs), item: [$name] [] [] [] [$($body)+] }
};
((($Rhs:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap($Rhs), item: [$name] [] [] [$($bound)*] [$($body)+] }
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap($Rhs), item: [$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
((<$($($T:ident),+ $(,)?)?>($Rhs:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_bin_op! { trait: ($crate::std_ops_Shr)::shr, kind: rhs_rewrap($Rhs), item: [$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$($body)+] }
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! wrap_un_op {
(
trait: ($($tr:tt)*)::$meth:ident,
kind: simple,
item: [$name:ident] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_un_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: simple,
item: [$name] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple,
item: [$name:ident] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_un_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: simple,
item: [$name] [$t0] [$([$phantom])*]
]
}
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple,
item: [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)* for $name $($r)* $($w)* {
type Output = Self;
fn $meth(self) -> Self {
$name(
<$t0 as $($tr)*>::$meth(self.0)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
(
trait: ($($tr:tt)*)::$meth:ident,
kind: simple_ref,
item: [$a:lifetime] [$name:ident] [$($bound:tt)*] [$($body:tt)+]
) => {
$crate::generics_parse! {
$crate::wrap_un_op {
generics_parse_done
[
trait: ($($tr)*)::$meth,
kind: simple_ref,
item: [$a] [$name] [$($bound)*]
]
}
$($body)+
}
};
(
generics_parse_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple_ref,
item: [$a:lifetime] [$name:ident] [$($bound:tt)*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_un_op {
generics_concat_done
[
trait: ($($tr)*)::$meth,
kind: simple_ref,
item: [$a] [$name] [$t0] [$([$phantom])*]
]
}
[ < $a > ] [] [],
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[
trait: ($($tr:tt)*)::$meth:ident,
kind: simple_ref,
item: [$a:lifetime] [$name:ident] [$t0:ty] [$([$phantom:ty])*]
]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
$crate::as_item! {
impl $($g)* $($tr)* for & $a $name $($r)* $($w)* {
type Output = $name $($r)*;
fn $meth(self) -> $name $($r)* {
$name(
<$t0 as $($tr)*>::$meth(self.0)
$(, <$phantom as $crate::std_default_Default>::default())*
)
}
}
}
};
}
#[macro_export]
macro_rules! NewtypeNeg {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeNeg! { () $vis struct $name $($body)+ }
$crate::NewtypeNeg! { (&self) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_un_op! { trait: ($crate::std_ops_Neg)::neg, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_un_op! { trait: ($crate::std_ops_Neg)::neg, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_un_op! { trait: ($crate::std_ops_Neg)::neg, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeNot {
((*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeNot! { () $vis struct $name $($body)+ }
$crate::NewtypeNot! { (&self) $vis struct $name $($body)+ }
};
(((*) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::NewtypeNot! { (where $($bound:tt)*) $vis struct $name $($body)+ }
$crate::NewtypeNot! { ((&self) where $($bound:tt)*) $vis struct $name $($body)+ }
};
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_un_op! { trait: ($crate::std_ops_Not)::not, kind: simple, item: [$name] [$($($bound)*)?] [$($body)+] }
};
((&self) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_un_op! { trait: ($crate::std_ops_Not)::not, kind: simple_ref, item: ['newtype_derive] [$name] [] [$($body)+] }
};
(((&self) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_un_op! { trait: ($crate::std_ops_Not)::not, kind: simple_ref, item: ['newtype_derive] [$name] [$($bound)*] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeDeref {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeDeref_impl {
generics_parse_done
[$name] [$($($bound)*)?]
}
$($body)+
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! NewtypeDeref_impl {
(
generics_parse_done
[$name:ident] [$($bound:tt)*]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::NewtypeDeref_impl {
generics_concat_done
[$name] [$t0]
}
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[$name:ident] [$t0:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
impl $($g)* $crate::std_ops_Deref for $name $($r)* $($w)* {
type Target = <$t0 as $crate::std_ops_Deref>::Target;
fn deref(&self) -> &Self::Target { &self.0 }
}
};
}
#[macro_export]
macro_rules! NewtypeDerefMut {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeDerefMut_impl {
generics_parse_done
[$name] [$($bound)*]
}
$($body)+
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! NewtypeDerefMut_impl {
(
generics_parse_done
[$name:ident] [$($bound:tt)*]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::NewtypeDerefMut_impl {
generics_concat_done
[$name] [$t0]
}
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[$name:ident] [$t0:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
impl $($g)* $crate::std_ops_DerefMut for $name $($r)* $($w)* {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
}
};
}
#[macro_export]
macro_rules! NewtypeIndex {
(($Index:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndex_impl {
generics_parse_done
[$name] [] [] [] [$Index]
}
$($body)+
}
};
((($Index:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndex_impl {
generics_parse_done
[$name] [] [] [$($bound)*] [$Index]
}
$($body)+
}
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Index:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndex_impl {
generics_parse_done
[$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$Index]
}
$($body)+
}
};
((<$($($T:ident),+ $(,)?)?>($Index:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndex_impl {
generics_parse_done
[$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$Index]
}
$($body)+
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! NewtypeIndex_impl {
(
generics_parse_done
[$name:ident] [$($lt:tt)*] [$($T:tt)*] [$($bound:tt)*] [$Index:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::NewtypeIndex_impl {
generics_concat_done
[$name] [$Index] [$t0]
}
[$($lt)*] [] [],
[$($g)*] [$($r)*] [$($w)*],
[$($T)*] [] [],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[$name:ident] [$Index:ty] [$t0:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
impl $($g)* $crate::std_ops_Index<$Index> for $name $($r)* $($w)* {
type Output = <$t0 as $crate::std_ops_Index<$Index>>::Output;
fn index(&self, index: $Index) -> &Self::Output {
<$t0 as $crate::std_ops_Index<$Index>>::index(&self.0, index)
}
}
};
}
#[macro_export]
macro_rules! NewtypeIndexMut {
(($Index:ty) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndexMut_impl {
generics_parse_done
[$name] [] [] [] [$Index]
}
$($body)+
}
};
((($Index:ty) where $($bound:tt)*) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndexMut_impl {
generics_parse_done
[$name] [] [] [$($bound)*] [$Index]
}
$($body)+
}
};
((<$($lt:lifetime),+ $(, $($T:ident),+)? $(,)?>($Index:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndexMut_impl {
generics_parse_done
[$name] [ < $($lt),+ > ] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$Index]
}
$($body)+
}
};
((<$($($T:ident),+ $(,)?)?>($Index:ty) $(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::generics_parse! {
$crate::NewtypeIndexMut_impl {
generics_parse_done
[$name] [] [ $( < $($T),+ > )? ] [$($($bound)*)?] [$Index]
}
$($body)+
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! NewtypeIndexMut_impl {
(
generics_parse_done
[$name:ident] [$($lt:tt)*] [$($T:tt)*] [$($bound:tt)*] [$Index:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::NewtypeIndexMut_impl {
generics_concat_done
[$name] [$Index] [$t0]
}
[$($lt)*] [] [],
[$($g)*] [$($r)*] [$($w)*],
[$($T)*] [] [],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[$name:ident] [$Index:ty] [$t0:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
impl $($g)* $crate::std_ops_IndexMut<$Index> for $name $($r)* $($w)* {
fn index_mut(&mut self, index: $Index) -> &mut Self::Output {
<$t0 as $crate::std_ops_IndexMut<$Index>>::index_mut(&mut self.0, index)
}
}
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! wrap_fmt {
([$tr:path] [$name:ident] [$($bound:tt)*] [$($body:tt)+]) => {
$crate::generics_parse! {
$crate::wrap_fmt {
generics_parse_done
[$tr] [$name] [$($bound)*]
}
$($body)+
}
};
(
generics_parse_done
[$tr:path] [$name:ident] [$($bound:tt)*]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
($(pub)? $t0:ty $(, $(pub)? $phantom:ty)* $(,)?);
) => {
$crate::generics_concat! {
$crate::wrap_fmt {
generics_concat_done
[$tr] [$name] [$t0]
}
[$($g)*] [$($r)*] [$($w)*],
[] [] [where $($bound)*]
}
};
(
generics_concat_done
[$tr:path] [$name:ident] [$t0:ty]
[$($g:tt)*] [$($r:tt)*] [$($w:tt)*]
) => {
impl $($g)* $tr for $name $($r)* $($w)* {
fn fmt(&self, f: &mut $crate::std_fmt_Formatter) -> $crate::std_fmt_Result {
<$t0 as $tr>::fmt(&self.0, f)
}
}
};
}
#[macro_export]
macro_rules! NewtypeBinary {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_Binary] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeDebug {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_Debug] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeDisplay {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_Display] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeLowerExp {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_LowerExp] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeLowerHex {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_LowerHex] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeOctal {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_Octal] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypePointer {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_Pointer] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeUpperExp {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_UpperExp] [$name] [$($($bound)*)?] [$($body)+] }
};
}
#[macro_export]
macro_rules! NewtypeUpperHex {
(($(where $($bound:tt)*)?) $vis:vis struct $name:ident $($body:tt)+) => {
$crate::wrap_fmt! { [$crate::std_fmt_UpperHex] [$name] [$($($bound)*)?] [$($body)+] }
};
}