@@ -1340,13 +1340,15 @@ assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($Sel
1340
1340
"::MIN, true));" , $EndFeature, "
1341
1341
```" ) ,
1342
1342
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
1343
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
1343
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
1344
1344
#[ inline]
1345
1345
pub const fn overflowing_add( self , rhs: Self ) -> ( Self , bool ) {
1346
+ #[ cfg( stage0) ]
1346
1347
let ( a, b) = unsafe {
1347
- intrinsics:: add_with_overflow( self as $ActualT,
1348
- rhs as $ActualT)
1348
+ intrinsics:: add_with_overflow( self as $ActualT, rhs as $ActualT)
1349
1349
} ;
1350
+ #[ cfg( not( stage0) ) ]
1351
+ let ( a, b) = intrinsics:: add_with_overflow( self as $ActualT, rhs as $ActualT) ;
1350
1352
( a as Self , b)
1351
1353
}
1352
1354
}
@@ -1369,13 +1371,15 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($Sel
1369
1371
"::MAX, true));" , $EndFeature, "
1370
1372
```" ) ,
1371
1373
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
1372
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
1374
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
1373
1375
#[ inline]
1374
1376
pub const fn overflowing_sub( self , rhs: Self ) -> ( Self , bool ) {
1377
+ #[ cfg( stage0) ]
1375
1378
let ( a, b) = unsafe {
1376
- intrinsics:: sub_with_overflow( self as $ActualT,
1377
- rhs as $ActualT)
1379
+ intrinsics:: sub_with_overflow( self as $ActualT, rhs as $ActualT)
1378
1380
} ;
1381
+ #[ cfg( not( stage0) ) ]
1382
+ let ( a, b) = intrinsics:: sub_with_overflow( self as $ActualT, rhs as $ActualT) ;
1379
1383
( a as Self , b)
1380
1384
}
1381
1385
}
@@ -1396,13 +1400,15 @@ assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));",
1396
1400
$EndFeature, "
1397
1401
```" ) ,
1398
1402
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
1399
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
1403
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
1400
1404
#[ inline]
1401
1405
pub const fn overflowing_mul( self , rhs: Self ) -> ( Self , bool ) {
1406
+ #[ cfg( stage0) ]
1402
1407
let ( a, b) = unsafe {
1403
- intrinsics:: mul_with_overflow( self as $ActualT,
1404
- rhs as $ActualT)
1408
+ intrinsics:: mul_with_overflow( self as $ActualT, rhs as $ActualT)
1405
1409
} ;
1410
+ #[ cfg( not( stage0) ) ]
1411
+ let ( a, b) = intrinsics:: mul_with_overflow( self as $ActualT, rhs as $ActualT) ;
1406
1412
( a as Self , b)
1407
1413
}
1408
1414
}
@@ -1585,7 +1591,7 @@ assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));",
1585
1591
$EndFeature, "
1586
1592
```" ) ,
1587
1593
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
1588
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
1594
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
1589
1595
#[ inline]
1590
1596
pub const fn overflowing_shl( self , rhs: u32 ) -> ( Self , bool ) {
1591
1597
( self . wrapping_shl( rhs) , ( rhs > ( $BITS - 1 ) ) )
@@ -1609,7 +1615,7 @@ assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));",
1609
1615
$EndFeature, "
1610
1616
```" ) ,
1611
1617
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
1612
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
1618
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
1613
1619
#[ inline]
1614
1620
pub const fn overflowing_shr( self , rhs: u32 ) -> ( Self , bool ) {
1615
1621
( self . wrapping_shr( rhs) , ( rhs > ( $BITS - 1 ) ) )
@@ -3213,13 +3219,15 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));
3213
3219
assert_eq!(" , stringify!( $SelfT) , "::MAX.overflowing_add(1), (0, true));" , $EndFeature, "
3214
3220
```" ) ,
3215
3221
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
3216
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
3222
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
3217
3223
#[ inline]
3218
3224
pub const fn overflowing_add( self , rhs: Self ) -> ( Self , bool ) {
3225
+ #[ cfg( stage0) ]
3219
3226
let ( a, b) = unsafe {
3220
- intrinsics:: add_with_overflow( self as $ActualT,
3221
- rhs as $ActualT)
3227
+ intrinsics:: add_with_overflow( self as $ActualT, rhs as $ActualT)
3222
3228
} ;
3229
+ #[ cfg( not( stage0) ) ]
3230
+ let ( a, b) = intrinsics:: add_with_overflow( self as $ActualT, rhs as $ActualT) ;
3223
3231
( a as Self , b)
3224
3232
}
3225
3233
}
@@ -3243,13 +3251,15 @@ assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT),
3243
3251
$EndFeature, "
3244
3252
```" ) ,
3245
3253
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
3246
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
3254
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
3247
3255
#[ inline]
3248
3256
pub const fn overflowing_sub( self , rhs: Self ) -> ( Self , bool ) {
3257
+ #[ cfg( stage0) ]
3249
3258
let ( a, b) = unsafe {
3250
- intrinsics:: sub_with_overflow( self as $ActualT,
3251
- rhs as $ActualT)
3259
+ intrinsics:: sub_with_overflow( self as $ActualT, rhs as $ActualT)
3252
3260
} ;
3261
+ #[ cfg( not( stage0) ) ]
3262
+ let ( a, b) = intrinsics:: sub_with_overflow( self as $ActualT, rhs as $ActualT) ;
3253
3263
( a as Self , b)
3254
3264
}
3255
3265
}
@@ -3272,13 +3282,15 @@ $EndFeature, "
3272
3282
/// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
3273
3283
/// ```
3274
3284
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
3275
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
3285
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
3276
3286
#[ inline]
3277
3287
pub const fn overflowing_mul( self , rhs: Self ) -> ( Self , bool ) {
3288
+ #[ cfg( stage0) ]
3278
3289
let ( a, b) = unsafe {
3279
- intrinsics:: mul_with_overflow( self as $ActualT,
3280
- rhs as $ActualT)
3290
+ intrinsics:: mul_with_overflow( self as $ActualT, rhs as $ActualT)
3281
3291
} ;
3292
+ #[ cfg( not( stage0) ) ]
3293
+ let ( a, b) = intrinsics:: mul_with_overflow( self as $ActualT, rhs as $ActualT) ;
3282
3294
( a as Self , b)
3283
3295
}
3284
3296
@@ -3436,7 +3448,7 @@ Basic usage
3436
3448
assert_eq!(0x1" , stringify!( $SelfT) , ".overflowing_shl(132), (0x10, true));" , $EndFeature, "
3437
3449
```" ) ,
3438
3450
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
3439
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
3451
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
3440
3452
#[ inline]
3441
3453
pub const fn overflowing_shl( self , rhs: u32 ) -> ( Self , bool ) {
3442
3454
( self . wrapping_shl( rhs) , ( rhs > ( $BITS - 1 ) ) )
@@ -3461,7 +3473,7 @@ Basic usage
3461
3473
assert_eq!(0x10" , stringify!( $SelfT) , ".overflowing_shr(132), (0x1, true));" , $EndFeature, "
3462
3474
```" ) ,
3463
3475
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
3464
- #[ rustc_const_unstable( feature = "const_int_overflowing" ) ]
3476
+ #[ cfg_attr ( stage0 , rustc_const_unstable( feature = "const_int_overflowing" ) ) ]
3465
3477
#[ inline]
3466
3478
pub const fn overflowing_shr( self , rhs: u32 ) -> ( Self , bool ) {
3467
3479
( self . wrapping_shr( rhs) , ( rhs > ( $BITS - 1 ) ) )
0 commit comments