macro_rules! forward_ref_unop {
    (
        $( [ $($generic:tt)* ] )?
        impl Neg for $type:ty
        $( where $($bound:tt)* )?
    ) => { ... };
    (
        $( [ $($generic:tt)* ] )?
        impl $impl:ident, $meth:ident for $type:ty
        $( where $($bound:tt)* )?
    ) => { ... };
}
Expand description

For a type T: Copy which has unary operator unop implemented, also implement unop &T.

For readability, the expected syntax of the macro is the following:

( [ Generics ] )?
impl Trait, Method for Type
( where Bounds )?
  • Generics are comma-seperated type or const generics
  • Trait is the trait to be implemented
  • Method is the method that Trait defines
    (can be ommitted for Neg)
  • Type is the type that Trait is implemented on (i.e. T)
  • Bounds are comma-seperated trait bounds for the listed generics