core: mark relevant functions with #[rustc_inherit_overflow_checks].
This commit is contained in:
@@ -1033,7 +1033,7 @@ macro_rules! int_impl {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
|
||||
#[rustc_inherit_overflow_checks]
|
||||
pub fn pow(self, mut exp: u32) -> Self {
|
||||
let mut base = self;
|
||||
let mut acc = Self::one();
|
||||
@@ -1075,7 +1075,7 @@ macro_rules! int_impl {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
|
||||
#[rustc_inherit_overflow_checks]
|
||||
pub fn abs(self) -> Self {
|
||||
if self.is_negative() {
|
||||
// Note that the #[inline] above means that the overflow
|
||||
@@ -2061,7 +2061,7 @@ macro_rules! uint_impl {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
|
||||
#[rustc_inherit_overflow_checks]
|
||||
pub fn pow(self, mut exp: u32) -> Self {
|
||||
let mut base = self;
|
||||
let mut acc = Self::one();
|
||||
|
||||
Reference in New Issue
Block a user