macro_rules! forward_ref_op_assign {
(
$( [ $($generic:tt)* ] )?
impl AddAssign for $lhs:ty $(, $rhs:ty )?
$( where $($bound:tt)* )?
) => { ... };
(
$( [ $($generic:tt)* ] )?
impl SubAssign for $lhs:ty $(, $rhs:ty )?
$( where $($bound:tt)* )?
) => { ... };
(
$( [ $($generic:tt)* ] )?
impl MulAssign for $lhs:ty $(, $rhs:ty )?
$( where $($bound:tt)* )?
) => { ... };
(
$( [ $($generic:tt)* ] )?
impl DivAssign for $lhs:ty $(, $rhs:ty )?
$( where $($bound:tt)* )?
) => { ... };
(
$( [ $($generic:tt)* ] )?
impl $impl:ident, $meth:ident for $lhs:ty
$( where $($bound:tt)* )?
) => { ... };
(
$( [ $($generic:tt)* ] )?
impl $impl:ident, $meth:ident for $lhs:ty, $rhs:ty
$( where $($bound:tt)* )?
) => { ... };
}Expand description
For types T: Copy, U: Copy for which assignment operator assop is implemented (T assop U), also implement T assop &U.
For readability, the expected syntax of the macro is the following:
( [ Generics ] )?
impl Trait, Method for LHS(, RHS)?
( where Bounds )?Genericsare comma-seperated type or const genericsTraitis the trait to be implementedMethodis the method thatTraitdefines
(can be ommitted forAddAssign,SubAssign,MulAssignandDivAssign)LHSis the type of the left hand side of the operation (i.e.T)RHSis the type of the right hand side of the operation (i.e.U)
if noRHSis given,LHS=RHSis assumedBoundsare comma-seperated trait bounds for the listed generics