Skip to content

Commit

Permalink
Merge #145
Browse files Browse the repository at this point in the history
145: Remove Neg for BigUint r=cuviper a=cuviper

A panicking implementation is useless, or worse because it still
satisfies `T: Neg`. This artifact dates back to when `BigUint` was still
in the standard library, but the rest of the primitive unsigned `Neg`
implementations were removed before Rust 1.0.

Co-authored-by: Josh Stone <[email protected]>
  • Loading branch information
bors[bot] and cuviper authored Apr 14, 2020
2 parents 4239ddd + 67f06f3 commit 5b679e4
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/biguint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use core::iter::{Product, Sum};
use core::mem;
use core::ops::{
Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
Mul, MulAssign, Neg, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
Mul, MulAssign, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
};
use core::str::{self, FromStr};
use core::{f32, f64};
Expand Down Expand Up @@ -1495,24 +1495,6 @@ impl Rem<BigUint> for u128 {
}
}

impl Neg for BigUint {
type Output = BigUint;

#[inline]
fn neg(self) -> BigUint {
panic!()
}
}

impl<'a> Neg for &'a BigUint {
type Output = BigUint;

#[inline]
fn neg(self) -> BigUint {
panic!()
}
}

impl CheckedAdd for BigUint {
#[inline]
fn checked_add(&self, v: &BigUint) -> Option<BigUint> {
Expand Down

0 comments on commit 5b679e4

Please sign in to comment.