diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 982729388c8..ac6cd2711d5 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1130,9 +1130,9 @@ pub const fn wrapping_rem_euclid(self, rhs: Self) -> Self { /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] #[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")] - #[inline] + #[inline(always)] pub const fn wrapping_neg(self) -> Self { - self.overflowing_neg().0 + (0 as $SelfT).wrapping_sub(self) } /// Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index ca1b05fdfbe..97f3d17cf08 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1245,9 +1245,9 @@ pub const fn wrapping_rem_euclid(self, rhs: Self) -> Self { /// ``` #[stable(feature = "num_wrapping", since = "1.2.0")] #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] - #[inline] + #[inline(always)] pub const fn wrapping_neg(self) -> Self { - self.overflowing_neg().0 + (0 as $SelfT).wrapping_sub(self) } /// Panic-free bitwise shift-left; yields `self << mask(rhs)`,