Skip to content

Commit

Permalink
Avoid 'unsigned' and 'type' as macro variable
Browse files Browse the repository at this point in the history
It seems to break R1.15
  • Loading branch information
thomwiggers committed Jul 19, 2018
1 parent 5fe8a5f commit de5b78c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,21 +829,21 @@ fn powsign<T: Integer>(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))
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/biguint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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)
}
}
Expand Down

0 comments on commit de5b78c

Please sign in to comment.