From de5b78c26afd615a035342e7711c4fa08b4acfdd Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Thu, 19 Jul 2018 17:15:06 +0200 Subject: [PATCH] Avoid 'unsigned' and 'type' as macro variable It seems to break R1.15 --- src/bigint.rs | 10 +++++----- src/biguint.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bigint.rs b/src/bigint.rs index 27afed12..520e37dc 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -829,21 +829,21 @@ fn powsign(sign: Sign, other: &T) -> Sign { } macro_rules! pow_impl { - ($type:ty) => { - impl<'a> Pow<$type> for &'a BigInt { + ($T:ty) => { + impl<'a> Pow<$T> for &'a BigInt { type Output = BigInt; #[inline] - fn pow(self, rhs: $type) -> BigInt { + fn pow(self, rhs: $T) -> BigInt { BigInt::from_biguint(powsign(self.sign, &rhs), (&self.data).pow(rhs)) } } - impl<'a, 'b> Pow<&'b $type> for &'a BigInt { + impl<'a, 'b> Pow<&'b $T> for &'a BigInt { type Output = BigInt; #[inline] - fn pow(self, rhs: &$type) -> BigInt { + fn pow(self, rhs: &$T) -> BigInt { BigInt::from_biguint(powsign(self.sign, rhs), (&self.data).pow(rhs)) } } diff --git a/src/biguint.rs b/src/biguint.rs index 826c95b6..795ae323 100644 --- a/src/biguint.rs +++ b/src/biguint.rs @@ -435,12 +435,12 @@ impl One for BigUint { impl Unsigned for BigUint {} macro_rules! pow_impl { - ($unsigned:ty) => { - impl<'a> Pow<$unsigned> for &'a BigUint { + ($T:ty) => { + impl<'a> Pow<$T> for &'a BigUint { type Output = BigUint; #[inline] - fn pow(self, mut exp: $unsigned) -> Self::Output { + fn pow(self, mut exp: $T) -> Self::Output { if exp == 0 { return BigUint::one(); } let mut base = self.clone(); @@ -464,11 +464,11 @@ macro_rules! pow_impl { } } - impl<'a, 'b> Pow<&'b $unsigned> for &'a BigUint { + impl<'a, 'b> Pow<&'b $T> for &'a BigUint { type Output = BigUint; #[inline] - fn pow(self, exp: &$unsigned) -> Self::Output { + fn pow(self, exp: &$T) -> Self::Output { self.pow(*exp) } }