@@ -1338,11 +1338,23 @@ $EndFeature, "
1338
1338
#[ must_use = "this returns the result of the operation, \
1339
1339
without modifying the original"]
1340
1340
#[ inline]
1341
- pub fn wrapping_div( self , rhs: Self ) -> Self {
1341
+ #[ rustc_const_unstable( feature = "const_int_wrapping" ) ]
1342
+ #[ cfg( not( bootstrap) ) ]
1343
+ pub const fn wrapping_div( self , rhs: Self ) -> Self {
1342
1344
self . overflowing_div( rhs) . 0
1343
1345
}
1344
1346
}
1345
1347
1348
+ /// No docs for bootstrap.
1349
+ #[ stable( feature = "num_wrapping" , since = "1.2.0" ) ]
1350
+ #[ must_use = "this returns the result of the operation, \
1351
+ without modifying the original"]
1352
+ #[ inline]
1353
+ #[ cfg( bootstrap) ]
1354
+ pub fn wrapping_div( self , rhs: Self ) -> Self {
1355
+ self . overflowing_div( rhs) . 0
1356
+ }
1357
+
1346
1358
doc_comment! {
1347
1359
concat!( "Wrapping Euclidean division. Computes `self.div_euclid(rhs)`,
1348
1360
wrapping around at the boundary of the type.
@@ -1397,11 +1409,23 @@ $EndFeature, "
1397
1409
#[ must_use = "this returns the result of the operation, \
1398
1410
without modifying the original"]
1399
1411
#[ inline]
1400
- pub fn wrapping_rem( self , rhs: Self ) -> Self {
1412
+ #[ rustc_const_unstable( feature = "const_int_wrapping" ) ]
1413
+ #[ cfg( not( bootstrap) ) ]
1414
+ pub const fn wrapping_rem( self , rhs: Self ) -> Self {
1401
1415
self . overflowing_rem( rhs) . 0
1402
1416
}
1403
1417
}
1404
1418
1419
+ /// No docs for bootstrap.
1420
+ #[ stable( feature = "num_wrapping" , since = "1.2.0" ) ]
1421
+ #[ must_use = "this returns the result of the operation, \
1422
+ without modifying the original"]
1423
+ #[ inline]
1424
+ #[ cfg( bootstrap) ]
1425
+ pub fn wrapping_rem( self , rhs: Self ) -> Self {
1426
+ self . overflowing_rem( rhs) . 0
1427
+ }
1428
+
1405
1429
doc_comment! {
1406
1430
concat!( "Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around
1407
1431
at the boundary of the type.
@@ -3422,7 +3446,7 @@ $EndFeature, "
3422
3446
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3423
3447
#[ rustc_const_stable( feature = "const_wrapping_math" , since = "1.32.0" ) ]
3424
3448
#[ must_use = "this returns the result of the operation, \
3425
- without modifying the original"]
3449
+ without modifying the original"]
3426
3450
#[ inline]
3427
3451
pub const fn wrapping_mul( self , rhs: Self ) -> Self {
3428
3452
intrinsics:: wrapping_mul( self , rhs)
@@ -3446,11 +3470,23 @@ Basic usage:
3446
3470
#[ must_use = "this returns the result of the operation, \
3447
3471
without modifying the original"]
3448
3472
#[ inline]
3449
- pub fn wrapping_div( self , rhs: Self ) -> Self {
3473
+ #[ rustc_const_unstable( feature = "const_int_wrapping" ) ]
3474
+ #[ cfg( not( bootstrap) ) ]
3475
+ pub const fn wrapping_div( self , rhs: Self ) -> Self {
3450
3476
self / rhs
3451
3477
}
3452
3478
}
3453
3479
3480
+ /// No docs for bootstrap.
3481
+ #[ stable( feature = "num_wrapping" , since = "1.2.0" ) ]
3482
+ #[ must_use = "this returns the result of the operation, \
3483
+ without modifying the original"]
3484
+ #[ inline]
3485
+ #[ cfg( bootstrap) ]
3486
+ pub fn wrapping_div( self , rhs: Self ) -> Self {
3487
+ self / rhs
3488
+ }
3489
+
3454
3490
doc_comment! {
3455
3491
concat!( "Wrapping Euclidean division. Computes `self.div_euclid(rhs)`.
3456
3492
Wrapped division on unsigned types is just normal division.
@@ -3496,11 +3532,23 @@ Basic usage:
3496
3532
#[ must_use = "this returns the result of the operation, \
3497
3533
without modifying the original"]
3498
3534
#[ inline]
3499
- pub fn wrapping_rem( self , rhs: Self ) -> Self {
3535
+ #[ rustc_const_unstable( feature = "const_int_wrapping" ) ]
3536
+ #[ cfg( not( bootstrap) ) ]
3537
+ pub const fn wrapping_rem( self , rhs: Self ) -> Self {
3500
3538
self % rhs
3501
3539
}
3502
3540
}
3503
3541
3542
+ /// No docs for bootstrap.
3543
+ #[ stable( feature = "num_wrapping" , since = "1.2.0" ) ]
3544
+ #[ must_use = "this returns the result of the operation, \
3545
+ without modifying the original"]
3546
+ #[ inline]
3547
+ #[ cfg( bootstrap) ]
3548
+ pub fn wrapping_rem( self , rhs: Self ) -> Self {
3549
+ self % rhs
3550
+ }
3551
+
3504
3552
doc_comment! {
3505
3553
concat!( "Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`.
3506
3554
Wrapped modulo calculation on unsigned types is
0 commit comments