@@ -777,10 +777,11 @@ assert_eq!((1", stringify!($SelfT), ").checked_div(0), None);",
777
777
$EndFeature, "
778
778
```" ) ,
779
779
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
780
+ #[ rustc_const_unstable( feature = "const_int_checked" , issue = "53718" ) ]
780
781
#[ must_use = "this returns the result of the operation, \
781
782
without modifying the original"]
782
783
#[ inline]
783
- pub fn checked_div( self , rhs: Self ) -> Option <Self > {
784
+ pub const fn checked_div( self , rhs: Self ) -> Option <Self > {
784
785
if rhs == 0 || ( self == Self :: min_value( ) && rhs == -1 ) {
785
786
None
786
787
} else {
@@ -835,10 +836,11 @@ assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);",
835
836
$EndFeature, "
836
837
```" ) ,
837
838
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
839
+ #[ rustc_const_unstable( feature = "const_int_checked" , issue = "53718" ) ]
838
840
#[ must_use = "this returns the result of the operation, \
839
841
without modifying the original"]
840
842
#[ inline]
841
- pub fn checked_rem( self , rhs: Self ) -> Option <Self > {
843
+ pub const fn checked_rem( self , rhs: Self ) -> Option <Self > {
842
844
if rhs == 0 || ( self == Self :: min_value( ) && rhs == -1 ) {
843
845
None
844
846
} else {
@@ -2937,10 +2939,11 @@ Basic usage:
2937
2939
assert_eq!(1" , stringify!( $SelfT) , ".checked_div(0), None);" , $EndFeature, "
2938
2940
```" ) ,
2939
2941
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2942
+ #[ rustc_const_unstable( feature = "const_int_checked" , issue = "53718" ) ]
2940
2943
#[ must_use = "this returns the result of the operation, \
2941
2944
without modifying the original"]
2942
2945
#[ inline]
2943
- pub fn checked_div( self , rhs: Self ) -> Option <Self > {
2946
+ pub const fn checked_div( self , rhs: Self ) -> Option <Self > {
2944
2947
match rhs {
2945
2948
0 => None ,
2946
2949
// SAFETY: div by zero has been checked above and unsigned types have no other
@@ -2990,10 +2993,11 @@ Basic usage:
2990
2993
assert_eq!(5" , stringify!( $SelfT) , ".checked_rem(0), None);" , $EndFeature, "
2991
2994
```" ) ,
2992
2995
#[ stable( feature = "wrapping" , since = "1.7.0" ) ]
2996
+ #[ rustc_const_unstable( feature = "const_int_checked" , issue = "53718" ) ]
2993
2997
#[ must_use = "this returns the result of the operation, \
2994
2998
without modifying the original"]
2995
2999
#[ inline]
2996
- pub fn checked_rem( self , rhs: Self ) -> Option <Self > {
3000
+ pub const fn checked_rem( self , rhs: Self ) -> Option <Self > {
2997
3001
if rhs == 0 {
2998
3002
None
2999
3003
} else {
0 commit comments