Auto merge of #33067 - notriddle:wrapping_neg, r=alexcrichton
Implement negation for wrapping numerals. Fixes #33037
This commit is contained in:
commit
3f65afa694
@ -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
|
||||
}
|
||||
}
|
||||
)*)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user