Skip to content

Commit 5b679e4

Browse files
bors[bot]cuviper
andauthored
Merge #145
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]>
2 parents 4239ddd + 67f06f3 commit 5b679e4

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/biguint.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::iter::{Product, Sum};
1212
use core::mem;
1313
use core::ops::{
1414
Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Div, DivAssign,
15-
Mul, MulAssign, Neg, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
15+
Mul, MulAssign, Rem, RemAssign, Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign,
1616
};
1717
use core::str::{self, FromStr};
1818
use core::{f32, f64};
@@ -1495,24 +1495,6 @@ impl Rem<BigUint> for u128 {
14951495
}
14961496
}
14971497

1498-
impl Neg for BigUint {
1499-
type Output = BigUint;
1500-
1501-
#[inline]
1502-
fn neg(self) -> BigUint {
1503-
panic!()
1504-
}
1505-
}
1506-
1507-
impl<'a> Neg for &'a BigUint {
1508-
type Output = BigUint;
1509-
1510-
#[inline]
1511-
fn neg(self) -> BigUint {
1512-
panic!()
1513-
}
1514-
}
1515-
15161498
impl CheckedAdd for BigUint {
15171499
#[inline]
15181500
fn checked_add(&self, v: &BigUint) -> Option<BigUint> {

0 commit comments

Comments
 (0)