diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index e28a36af2f322..04e8bc4913bdc 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -275,6 +275,15 @@ macro_rules! wrapping_impl { *self = *self & other; } } + + #[stable(feature = "wrapping_neg", since = "1.10.0")] + impl Neg for Wrapping<$t> { + type Output = Self; + #[inline(always)] + fn neg(self) -> Self { + Wrapping(0) - self + } + } )*) }