@@ -208,6 +208,7 @@ macro_rules! add_impl {
208208 type Output = $t;
209209
210210 #[ inline]
211+ #[ rustc_inherit_overflow_checks]
211212 fn add( self , other: $t) -> $t { self + other }
212213 }
213214
@@ -261,6 +262,7 @@ macro_rules! sub_impl {
261262 type Output = $t;
262263
263264 #[ inline]
265+ #[ rustc_inherit_overflow_checks]
264266 fn sub( self , other: $t) -> $t { self - other }
265267 }
266268
@@ -314,6 +316,7 @@ macro_rules! mul_impl {
314316 type Output = $t;
315317
316318 #[ inline]
319+ #[ rustc_inherit_overflow_checks]
317320 fn mul( self , other: $t) -> $t { self * other }
318321 }
319322
@@ -511,6 +514,7 @@ macro_rules! neg_impl_core {
511514 type Output = $t;
512515
513516 #[ inline]
517+ #[ rustc_inherit_overflow_checks]
514518 fn neg( self ) -> $t { let $id = self ; $body }
515519 }
516520
@@ -788,6 +792,7 @@ macro_rules! shl_impl {
788792 type Output = $t;
789793
790794 #[ inline]
795+ #[ rustc_inherit_overflow_checks]
791796 fn shl( self , other: $f) -> $t {
792797 self << other
793798 }
@@ -859,6 +864,7 @@ macro_rules! shr_impl {
859864 type Output = $t;
860865
861866 #[ inline]
867+ #[ rustc_inherit_overflow_checks]
862868 fn shr( self , other: $f) -> $t {
863869 self >> other
864870 }
@@ -923,6 +929,7 @@ macro_rules! add_assign_impl {
923929 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
924930 impl AddAssign for $t {
925931 #[ inline]
932+ #[ rustc_inherit_overflow_checks]
926933 fn add_assign( & mut self , other: $t) { * self += other }
927934 }
928935 ) +)
@@ -967,6 +974,7 @@ macro_rules! sub_assign_impl {
967974 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
968975 impl SubAssign for $t {
969976 #[ inline]
977+ #[ rustc_inherit_overflow_checks]
970978 fn sub_assign( & mut self , other: $t) { * self -= other }
971979 }
972980 ) +)
@@ -1011,6 +1019,7 @@ macro_rules! mul_assign_impl {
10111019 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
10121020 impl MulAssign for $t {
10131021 #[ inline]
1022+ #[ rustc_inherit_overflow_checks]
10141023 fn mul_assign( & mut self , other: $t) { * self *= other }
10151024 }
10161025 ) +)
@@ -1275,6 +1284,7 @@ macro_rules! shl_assign_impl {
12751284 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
12761285 impl ShlAssign <$f> for $t {
12771286 #[ inline]
1287+ #[ rustc_inherit_overflow_checks]
12781288 fn shl_assign( & mut self , other: $f) {
12791289 * self <<= other
12801290 }
@@ -1337,6 +1347,7 @@ macro_rules! shr_assign_impl {
13371347 #[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
13381348 impl ShrAssign <$f> for $t {
13391349 #[ inline]
1350+ #[ rustc_inherit_overflow_checks]
13401351 fn shr_assign( & mut self , other: $f) {
13411352 * self >>= other
13421353 }
0 commit comments