From 67f06f37d08919d884000bcff35c504aa780dd31 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 13 Apr 2020 18:42:30 -0700 Subject: [PATCH] Remove Neg for BigUint 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. --- src/biguint.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/biguint.rs b/src/biguint.rs index 53684185..86c44cb5 100644 --- a/src/biguint.rs +++ b/src/biguint.rs @@ -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}; @@ -1495,24 +1495,6 @@ impl Rem 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 {