Macro marker_impls
macro marker_impls {
( $(#[$($meta:tt)*])* $Trait:ident for $({$($bounds:tt)*})? $T:ty $(, $($rest:tt)*)? ) => { ... },
( $(#[$($meta:tt)*])* $Trait:ident for ) => { ... },
( $(#[$($meta:tt)*])* unsafe $Trait:ident for $({$($bounds:tt)*})? $T:ty $(, $($rest:tt)*)? ) => { ... },
( $(#[$($meta:tt)*])* unsafe $Trait:ident for ) => { ... },
}
Implements a given marker trait for multiple types at the same time.
The basic syntax looks like this:
marker_impls! { MarkerTrait for u8, i8 }
You can also implement unsafe traits
marker_impls! { unsafe MarkerTrait for u8, i8 }
Add attributes to all impls:
marker_impls! {
#[allow(lint)]
#[unstable(feature = "marker_trait", issue = "none")]
MarkerTrait for u8, i8
}
And use generics:
marker_impls! {
MarkerTrait for
u8, i8,
{T: PointeeSized} *const T,
{T: PointeeSized} *mut T,
{T: MarkerTrait} PhantomData<T>,
u32,
}