reduce use of explicit lifetimes in trait implementation

This commit is contained in:
Trevor Spiteri 2020-09-22 19:30:16 +02:00
parent 36e6e6e0a6
commit 71a5e9d7e1
3 changed files with 79 additions and 79 deletions

View File

@ -32,7 +32,7 @@ use core::{
macro_rules! refs {
(impl $Imp:ident for $Fixed:ident$(($LeEqU:ident))* { $method:ident }) => {
impl<'a, Frac $(: $LeEqU)*> $Imp<$Fixed<Frac>> for &'a $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<$Fixed<Frac>> for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: $Fixed<Frac>) -> $Fixed<Frac> {
@ -40,7 +40,7 @@ macro_rules! refs {
}
}
impl<'a, Frac $(: $LeEqU)*> $Imp<&'a $Fixed<Frac>> for $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<&$Fixed<Frac>> for $Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: &$Fixed<Frac>) -> $Fixed<Frac> {
@ -48,7 +48,7 @@ macro_rules! refs {
}
}
impl<'a, 'b, Frac $(: $LeEqU)*> $Imp<&'a $Fixed<Frac>> for &'b $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<&$Fixed<Frac>> for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: &$Fixed<Frac>) -> $Fixed<Frac> {
@ -58,7 +58,7 @@ macro_rules! refs {
};
(impl $Imp:ident<$Inner:ty> for $Fixed:ident$(($LeEqU:ident))* { $method:ident }) => {
impl<'a, Frac $(: $LeEqU)*> $Imp<$Inner> for &'a $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<$Inner> for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: $Inner) -> $Fixed<Frac> {
@ -66,7 +66,7 @@ macro_rules! refs {
}
}
impl<'a, Frac $(: $LeEqU)*> $Imp<&'a $Inner> for $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<&$Inner> for $Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: &$Inner) -> $Fixed<Frac> {
@ -74,7 +74,7 @@ macro_rules! refs {
}
}
impl<'a, 'b, Frac $(: $LeEqU)*> $Imp<&'a $Inner> for &'b $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<&$Inner> for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: &$Inner) -> $Fixed<Frac> {
@ -86,7 +86,7 @@ macro_rules! refs {
macro_rules! refs_assign {
(impl $Imp:ident for $Fixed:ident$(($LeEqU:ident))* { $method:ident }) => {
impl<'a, Frac $(: $LeEqU)*> $Imp<&'a $Fixed<Frac>> for $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<&$Fixed<Frac>> for $Fixed<Frac> {
#[inline]
fn $method(&mut self, rhs: &$Fixed<Frac>) {
self.$method(*rhs);
@ -95,7 +95,7 @@ macro_rules! refs_assign {
};
(impl $Imp:ident<$Inner:ty> for $Fixed:ident$(($LeEqU:ident))* { $method:ident }) => {
impl<'a, Frac $(: $LeEqU)*> $Imp<&'a $Inner> for $Fixed<Frac> {
impl<Frac $(: $LeEqU)*> $Imp<&$Inner> for $Fixed<Frac> {
#[inline]
fn $method(&mut self, rhs: &$Inner) {
self.$method(*rhs);
@ -141,7 +141,7 @@ macro_rules! pass_one {
}
}
impl<'a, Frac> $Imp for &'a $Fixed<Frac> {
impl<Frac> $Imp for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self) -> $Fixed<Frac> {
@ -161,7 +161,7 @@ macro_rules! shift {
}
}
impl<'a, Frac> $Imp<$Rhs> for &'a $Fixed<Frac> {
impl<Frac> $Imp<$Rhs> for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: $Rhs) -> $Fixed<Frac> {
@ -169,7 +169,7 @@ macro_rules! shift {
}
}
impl<'a, Frac> $Imp<&'a $Rhs> for $Fixed<Frac> {
impl<Frac> $Imp<&$Rhs> for $Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: &$Rhs) -> $Fixed<Frac> {
@ -177,7 +177,7 @@ macro_rules! shift {
}
}
impl<'a, 'b, Frac> $Imp<&'a $Rhs> for &'b $Fixed<Frac> {
impl<Frac> $Imp<&$Rhs> for &$Fixed<Frac> {
type Output = $Fixed<Frac>;
#[inline]
fn $method(self, rhs: &$Rhs) -> $Fixed<Frac> {
@ -196,7 +196,7 @@ macro_rules! shift_assign {
}
}
impl<'a, Frac> $Imp<&'a $Rhs> for $Fixed<Frac> {
impl<Frac> $Imp<&$Rhs> for $Fixed<Frac> {
#[inline]
fn $method(&mut self, rhs: &$Rhs) {
self.$method(*rhs)
@ -247,7 +247,7 @@ macro_rules! fixed_arith {
}
}
impl<Frac, RhsFrac: $LeEqU> MulAssign<&'_ $Fixed<RhsFrac>> for $Fixed<Frac> {
impl<Frac, RhsFrac: $LeEqU> MulAssign<&$Fixed<RhsFrac>> for $Fixed<Frac> {
#[inline]
fn mul_assign(&mut self, rhs: &$Fixed<RhsFrac>) {
let (ans, overflow) = self.to_bits().mul_overflow(rhs.to_bits(), RhsFrac::U32);
@ -332,7 +332,7 @@ macro_rules! fixed_arith {
}
}
impl<'a, Frac: $LeEqU> Mul<&'a $Fixed<Frac>> for $Inner {
impl<Frac: $LeEqU> Mul<&$Fixed<Frac>> for $Inner {
type Output = $Fixed<Frac>;
#[inline]
fn mul(self, rhs: &$Fixed<Frac>) -> $Fixed<Frac> {
@ -340,7 +340,7 @@ macro_rules! fixed_arith {
}
}
impl<'a, Frac: $LeEqU> Mul<$Fixed<Frac>> for &'a $Inner {
impl<Frac: $LeEqU> Mul<$Fixed<Frac>> for &$Inner {
type Output = $Fixed<Frac>;
#[inline]
fn mul(self, rhs: $Fixed<Frac>) -> $Fixed<Frac> {
@ -348,7 +348,7 @@ macro_rules! fixed_arith {
}
}
impl<'a, 'b, Frac: $LeEqU> Mul<&'a $Fixed<Frac>> for &'b $Inner {
impl<Frac: $LeEqU> Mul<&$Fixed<Frac>> for &$Inner {
type Output = $Fixed<Frac>;
#[inline]
fn mul(self, rhs: &$Fixed<Frac>) -> $Fixed<Frac> {

View File

@ -926,21 +926,21 @@ macro_rules! op {
Unwrapped((self.0).$unwrapped(other.0))
}
}
impl<'a, F: Fixed> $Op<Unwrapped<F>> for &'a Unwrapped<F> {
impl<F: Fixed> $Op<Unwrapped<F>> for &Unwrapped<F> {
type Output = Unwrapped<F>;
#[inline]
fn $op(self, other: Unwrapped<F>) -> Unwrapped<F> {
Unwrapped((self.0).$unwrapped(other.0))
}
}
impl<'a, F: Fixed> $Op<&'a Unwrapped<F>> for Unwrapped<F> {
impl<F: Fixed> $Op<&Unwrapped<F>> for Unwrapped<F> {
type Output = Unwrapped<F>;
#[inline]
fn $op(self, other: &Unwrapped<F>) -> Unwrapped<F> {
Unwrapped((self.0).$unwrapped(other.0))
}
}
impl<'a, 'b, F: Fixed> $Op<&'a Unwrapped<F>> for &'b Unwrapped<F> {
impl<F: Fixed> $Op<&Unwrapped<F>> for &Unwrapped<F> {
type Output = Unwrapped<F>;
#[inline]
fn $op(self, other: &Unwrapped<F>) -> Unwrapped<F> {
@ -953,7 +953,7 @@ macro_rules! op {
self.0 = (self.0).$unwrapped(other.0);
}
}
impl<'a, F: Fixed> $OpAssign<&'a Unwrapped<F>> for Unwrapped<F> {
impl<F: Fixed> $OpAssign<&Unwrapped<F>> for Unwrapped<F> {
#[inline]
fn $op_assign(&mut self, other: &Unwrapped<F>) {
self.0 = (self.0).$unwrapped(other.0);
@ -974,9 +974,9 @@ macro_rules! op_bitwise {
Unwrapped((self.0).$op(other.0))
}
}
impl<'a, F> $Op<Unwrapped<F>> for &'a Unwrapped<F>
impl<F> $Op<Unwrapped<F>> for &Unwrapped<F>
where
&'a F: $Op<F, Output = F>,
for<'a> &'a F: $Op<F, Output = F>,
{
type Output = Unwrapped<F>;
#[inline]
@ -984,23 +984,23 @@ macro_rules! op_bitwise {
Unwrapped((self.0).$op(other.0))
}
}
impl<'a, F> $Op<&'a Unwrapped<F>> for Unwrapped<F>
impl<F> $Op<&Unwrapped<F>> for Unwrapped<F>
where
F: $Op<&'a F, Output = F>,
for<'a> F: $Op<&'a F, Output = F>,
{
type Output = Unwrapped<F>;
#[inline]
fn $op(self, other: &'a Unwrapped<F>) -> Unwrapped<F> {
fn $op(self, other: &Unwrapped<F>) -> Unwrapped<F> {
Unwrapped((self.0).$op(&other.0))
}
}
impl<'a, 'b, F> $Op<&'a Unwrapped<F>> for &'b Unwrapped<F>
impl<F> $Op<&Unwrapped<F>> for &Unwrapped<F>
where
&'b F: $Op<&'a F, Output = F>,
for<'a, 'b> &'a F: $Op<&'b F, Output = F>,
{
type Output = Unwrapped<F>;
#[inline]
fn $op(self, other: &'a Unwrapped<F>) -> Unwrapped<F> {
fn $op(self, other: &Unwrapped<F>) -> Unwrapped<F> {
Unwrapped((self.0).$op(&other.0))
}
}
@ -1013,12 +1013,12 @@ macro_rules! op_bitwise {
(self.0).$op_assign(other.0);
}
}
impl<'a, F> $OpAssign<&'a Unwrapped<F>> for Unwrapped<F>
impl<F> $OpAssign<&Unwrapped<F>> for Unwrapped<F>
where
F: $OpAssign<&'a F>,
for<'a> F: $OpAssign<&'a F>,
{
#[inline]
fn $op_assign(&mut self, other: &'a Unwrapped<F>) {
fn $op_assign(&mut self, other: &Unwrapped<F>) {
(self.0).$op_assign(&other.0);
}
}
@ -1043,9 +1043,9 @@ macro_rules! op_shift {
Unwrapped((self.0).$op(checked))
}
}
impl<'a, F> $Op<$Rhs> for &'a Unwrapped<F>
impl<F> $Op<$Rhs> for &Unwrapped<F>
where
&'a F: $Op<u32, Output = F>,
for<'a> &'a F: $Op<u32, Output = F>,
{
type Output = Unwrapped<F>;
#[inline]
@ -1056,7 +1056,7 @@ macro_rules! op_shift {
Unwrapped((self.0).$op(checked))
}
}
impl<'a, F> $Op<&'a $Rhs> for Unwrapped<F>
impl<F> $Op<&$Rhs> for Unwrapped<F>
where
F: $Op<u32, Output = F>,
{
@ -1069,9 +1069,9 @@ macro_rules! op_shift {
Unwrapped((self.0).$op(checked))
}
}
impl<'a, 'b, F> $Op<&'a $Rhs> for &'b Unwrapped<F>
impl<F> $Op<&$Rhs> for &Unwrapped<F>
where
&'b F: $Op<u32, Output = F>,
for<'a> &'a F: $Op<u32, Output = F>,
{
type Output = Unwrapped<F>;
#[inline]
@ -1094,7 +1094,7 @@ macro_rules! op_shift {
(self.0).$op_assign(checked);
}
}
impl<'a, F> $OpAssign<&'a $Rhs> for Unwrapped<F>
impl<F> $OpAssign<&$Rhs> for Unwrapped<F>
where
F: $OpAssign<u32>,
{
@ -1117,7 +1117,7 @@ impl<F: Fixed> Neg for Unwrapped<F> {
}
}
impl<'a, F: Fixed> Neg for &'a Unwrapped<F> {
impl<F: Fixed> Neg for &Unwrapped<F> {
type Output = Unwrapped<F>;
#[inline]
fn neg(self) -> Unwrapped<F> {
@ -1140,9 +1140,9 @@ where
Unwrapped((self.0).not())
}
}
impl<'a, F> Not for &'a Unwrapped<F>
impl<F> Not for &Unwrapped<F>
where
&'a F: Not<Output = F>,
for<'a> &'a F: Not<Output = F>,
{
type Output = Unwrapped<F>;
#[inline]
@ -1216,14 +1216,14 @@ impl<'a, F: 'a + Fixed> Product<&'a Unwrapped<F>> for Unwrapped<F> {
// example we cannot implement both these without triggering E0119:
//
// impl<F: Fixed> Op<F::Bits> for Unwrapped<F> { /* ... */ }
// impl<'a, F: Fixed> Op<&'a F::Bits> for Unwrapped<F> { /* ... */ }
// impl<F: Fixed> Op<&F::Bits> for Unwrapped<F> { /* ... */ }
//
// To work around this, we provide implementations like this:
//
// impl<Frac> Op<i8> for Unwrapped<FixedI8<Frac>> { /* ... */ }
// impl<'a, Frac> Op<&'a i8> for Unwrapped<FixedI8<Frac>> { /* ... */ }
// impl<Frac> Op<&i8> for Unwrapped<FixedI8<Frac>> { /* ... */ }
// impl<Frac> Op<i16> for Unwrapped<FixedI16<Frac>> { /* ... */ }
// impl<'a, Frac> Op<&'a i16> for Unwrapped<FixedI16<Frac>> { /* ... */ }
// impl<Frac> Op<&i16> for Unwrapped<FixedI16<Frac>> { /* ... */ }
// ...
macro_rules! op_bits {
@ -1239,21 +1239,21 @@ macro_rules! op_bits {
Unwrapped((self.0).$unwrapped(other))
}
}
impl<'a, Frac $(: $LeEqU)*> $Op<$Bits> for &'a Unwrapped<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $Op<$Bits> for &Unwrapped<$Fixed<Frac>> {
type Output = Unwrapped<$Fixed<Frac>>;
#[inline]
fn $op(self, other: $Bits) -> Unwrapped<$Fixed<Frac>> {
Unwrapped((self.0).$unwrapped(other))
}
}
impl<'a, Frac $(: $LeEqU)*> $Op<&'a $Bits> for Unwrapped<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $Op<&$Bits> for Unwrapped<$Fixed<Frac>> {
type Output = Unwrapped<$Fixed<Frac>>;
#[inline]
fn $op(self, other: &$Bits) -> Unwrapped<$Fixed<Frac>> {
Unwrapped((self.0).$unwrapped(*other))
}
}
impl<'a, 'b, Frac $(: $LeEqU)*> $Op<&'a $Bits> for &'b Unwrapped<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $Op<&$Bits> for &Unwrapped<$Fixed<Frac>> {
type Output = Unwrapped<$Fixed<Frac>>;
#[inline]
fn $op(self, other: &$Bits) -> Unwrapped<$Fixed<Frac>> {
@ -1266,7 +1266,7 @@ macro_rules! op_bits {
self.0 = (self.0).$unwrapped(other);
}
}
impl<'a, Frac $(: $LeEqU)*> $OpAssign<&'a $Bits> for Unwrapped<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $OpAssign<&$Bits> for Unwrapped<$Fixed<Frac>> {
#[inline]
fn $op_assign(&mut self, other: &$Bits) {
self.0 = (self.0).$unwrapped(*other);

View File

@ -840,21 +840,21 @@ macro_rules! op {
Wrapping((self.0).$wrapping(other.0))
}
}
impl<'a, F: Fixed> $Op<Wrapping<F>> for &'a Wrapping<F> {
impl<F: Fixed> $Op<Wrapping<F>> for &Wrapping<F> {
type Output = Wrapping<F>;
#[inline]
fn $op(self, other: Wrapping<F>) -> Wrapping<F> {
Wrapping((self.0).$wrapping(other.0))
}
}
impl<'a, F: Fixed> $Op<&'a Wrapping<F>> for Wrapping<F> {
impl<F: Fixed> $Op<&Wrapping<F>> for Wrapping<F> {
type Output = Wrapping<F>;
#[inline]
fn $op(self, other: &Wrapping<F>) -> Wrapping<F> {
Wrapping((self.0).$wrapping(other.0))
}
}
impl<'a, 'b, F: Fixed> $Op<&'a Wrapping<F>> for &'b Wrapping<F> {
impl<F: Fixed> $Op<&Wrapping<F>> for &Wrapping<F> {
type Output = Wrapping<F>;
#[inline]
fn $op(self, other: &Wrapping<F>) -> Wrapping<F> {
@ -867,7 +867,7 @@ macro_rules! op {
self.0 = (self.0).$wrapping(other.0);
}
}
impl<'a, F: Fixed> $OpAssign<&'a Wrapping<F>> for Wrapping<F> {
impl<F: Fixed> $OpAssign<&Wrapping<F>> for Wrapping<F> {
#[inline]
fn $op_assign(&mut self, other: &Wrapping<F>) {
self.0 = (self.0).$wrapping(other.0);
@ -888,9 +888,9 @@ macro_rules! op_bitwise {
Wrapping((self.0).$op(other.0))
}
}
impl<'a, F> $Op<Wrapping<F>> for &'a Wrapping<F>
impl<F> $Op<Wrapping<F>> for &Wrapping<F>
where
&'a F: $Op<F, Output = F>,
for<'a> &'a F: $Op<F, Output = F>,
{
type Output = Wrapping<F>;
#[inline]
@ -898,23 +898,23 @@ macro_rules! op_bitwise {
Wrapping((self.0).$op(other.0))
}
}
impl<'a, F> $Op<&'a Wrapping<F>> for Wrapping<F>
impl<F> $Op<&Wrapping<F>> for Wrapping<F>
where
F: $Op<&'a F, Output = F>,
for<'a> F: $Op<&'a F, Output = F>,
{
type Output = Wrapping<F>;
#[inline]
fn $op(self, other: &'a Wrapping<F>) -> Wrapping<F> {
fn $op(self, other: &Wrapping<F>) -> Wrapping<F> {
Wrapping((self.0).$op(&other.0))
}
}
impl<'a, 'b, F> $Op<&'a Wrapping<F>> for &'b Wrapping<F>
impl<F> $Op<&Wrapping<F>> for &Wrapping<F>
where
&'b F: $Op<&'a F, Output = F>,
for<'a, 'b> &'a F: $Op<&'b F, Output = F>,
{
type Output = Wrapping<F>;
#[inline]
fn $op(self, other: &'a Wrapping<F>) -> Wrapping<F> {
fn $op(self, other: &Wrapping<F>) -> Wrapping<F> {
Wrapping((self.0).$op(&other.0))
}
}
@ -927,12 +927,12 @@ macro_rules! op_bitwise {
(self.0).$op_assign(other.0);
}
}
impl<'a, F> $OpAssign<&'a Wrapping<F>> for Wrapping<F>
impl<F> $OpAssign<&Wrapping<F>> for Wrapping<F>
where
F: $OpAssign<&'a F>,
for<'a> F: $OpAssign<&'a F>,
{
#[inline]
fn $op_assign(&mut self, other: &'a Wrapping<F>) {
fn $op_assign(&mut self, other: &Wrapping<F>) {
(self.0).$op_assign(&other.0);
}
}
@ -955,9 +955,9 @@ macro_rules! op_shift {
Wrapping((self.0).$op(other as u32 % nbits))
}
}
impl<'a, F> $Op<$Rhs> for &'a Wrapping<F>
impl<F> $Op<$Rhs> for &Wrapping<F>
where
&'a F: $Op<u32, Output = F>,
for<'a> &'a F: $Op<u32, Output = F>,
{
type Output = Wrapping<F>;
#[inline]
@ -966,7 +966,7 @@ macro_rules! op_shift {
Wrapping((self.0).$op(other as u32 % nbits))
}
}
impl<'a, F> $Op<&'a $Rhs> for Wrapping<F>
impl<F> $Op<&$Rhs> for Wrapping<F>
where
F: $Op<u32, Output = F>,
{
@ -977,9 +977,9 @@ macro_rules! op_shift {
Wrapping((self.0).$op(*other as u32 % nbits))
}
}
impl<'a, 'b, F> $Op<&'a $Rhs> for &'b Wrapping<F>
impl<F> $Op<&$Rhs> for &Wrapping<F>
where
&'b F: $Op<u32, Output = F>,
for<'a> &'a F: $Op<u32, Output = F>,
{
type Output = Wrapping<F>;
#[inline]
@ -998,7 +998,7 @@ macro_rules! op_shift {
(self.0).$op_assign(other as u32 % nbits);
}
}
impl<'a, F> $OpAssign<&'a $Rhs> for Wrapping<F>
impl<F> $OpAssign<&$Rhs> for Wrapping<F>
where
F: $OpAssign<u32>,
{
@ -1019,7 +1019,7 @@ impl<F: Fixed> Neg for Wrapping<F> {
}
}
impl<'a, F: Fixed> Neg for &'a Wrapping<F> {
impl<F: Fixed> Neg for &Wrapping<F> {
type Output = Wrapping<F>;
#[inline]
fn neg(self) -> Wrapping<F> {
@ -1042,9 +1042,9 @@ where
Wrapping((self.0).not())
}
}
impl<'a, F> Not for &'a Wrapping<F>
impl<F> Not for &Wrapping<F>
where
&'a F: Not<Output = F>,
for<'a> &'a F: Not<Output = F>,
{
type Output = Wrapping<F>;
#[inline]
@ -1112,14 +1112,14 @@ impl<'a, F: 'a + Fixed> Product<&'a Wrapping<F>> for Wrapping<F> {
// example we cannot implement both these without triggering E0119:
//
// impl<F: Fixed> Op<F::Bits> for Wrapping<F> { /* ... */ }
// impl<'a, F: Fixed> Op<&'a F::Bits> for Wrapping<F> { /* ... */ }
// impl<F: Fixed> Op<&F::Bits> for Wrapping<F> { /* ... */ }
//
// To work around this, we provide implementations like this:
//
// impl<Frac> Op<i8> for Wrapping<FixedI8<Frac>> { /* ... */ }
// impl<'a, Frac> Op<&'a i8> for Wrapping<FixedI8<Frac>> { /* ... */ }
// impl<Frac> Op<&i8> for Wrapping<FixedI8<Frac>> { /* ... */ }
// impl<Frac> Op<i16> for Wrapping<FixedI16<Frac>> { /* ... */ }
// impl<'a, Frac> Op<&'a i16> for Wrapping<FixedI16<Frac>> { /* ... */ }
// impl<Frac> Op<&i16> for Wrapping<FixedI16<Frac>> { /* ... */ }
// ...
macro_rules! op_bits {
@ -1135,21 +1135,21 @@ macro_rules! op_bits {
Wrapping((self.0).$wrapping(other))
}
}
impl<'a, Frac $(: $LeEqU)*> $Op<$Bits> for &'a Wrapping<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $Op<$Bits> for &Wrapping<$Fixed<Frac>> {
type Output = Wrapping<$Fixed<Frac>>;
#[inline]
fn $op(self, other: $Bits) -> Wrapping<$Fixed<Frac>> {
Wrapping((self.0).$wrapping(other))
}
}
impl<'a, Frac $(: $LeEqU)*> $Op<&'a $Bits> for Wrapping<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $Op<&$Bits> for Wrapping<$Fixed<Frac>> {
type Output = Wrapping<$Fixed<Frac>>;
#[inline]
fn $op(self, other: &$Bits) -> Wrapping<$Fixed<Frac>> {
Wrapping((self.0).$wrapping(*other))
}
}
impl<'a, 'b, Frac $(: $LeEqU)*> $Op<&'a $Bits> for &'b Wrapping<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $Op<&$Bits> for &Wrapping<$Fixed<Frac>> {
type Output = Wrapping<$Fixed<Frac>>;
#[inline]
fn $op(self, other: &$Bits) -> Wrapping<$Fixed<Frac>> {
@ -1162,7 +1162,7 @@ macro_rules! op_bits {
self.0 = (self.0).$wrapping(other);
}
}
impl<'a, Frac $(: $LeEqU)*> $OpAssign<&'a $Bits> for Wrapping<$Fixed<Frac>> {
impl<Frac $(: $LeEqU)*> $OpAssign<&$Bits> for Wrapping<$Fixed<Frac>> {
#[inline]
fn $op_assign(&mut self, other: &$Bits) {
self.0 = (self.0).$wrapping(*other);