Skip to content

Commit

Permalink
Clean up const-hack from #58044
Browse files Browse the repository at this point in the history
  • Loading branch information
jumbatm committed Dec 27, 2019
1 parent 282635f commit 91c2f78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1709,8 +1709,13 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_neg(), (", stringify!($Self
#[inline]
#[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
#[allow_internal_unstable(const_if_match)]
pub const fn overflowing_neg(self) -> (Self, bool) {
((!self).wrapping_add(1), self == Self::min_value())
if self == Self::min_value() {
(Self::min_value(), true)
} else {
(-self, false)
}
}
}

Expand Down

0 comments on commit 91c2f78

Please sign in to comment.