Auto merge of #33067 - notriddle:wrapping_neg, r=alexcrichton

Implement negation for wrapping numerals.

Fixes #33037
This commit is contained in:
bors 2016-05-05 00:37:56 -07:00
commit 3f65afa694

View File

@ -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
}
}
)*)
}