@@ -1387,6 +1387,7 @@ from_str_radix_int_impl! { isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128 }
13871387#[ doc( hidden) ]
13881388#[ inline( always) ]
13891389#[ unstable( issue = "none" , feature = "std_internals" ) ]
1390+ #[ rustc_const_unstable( issue = "none" , feature = "const_int_cannot_overflow" ) ]
13901391pub const fn can_not_overflow < T > ( radix : u32 , is_signed_ty : bool , digits : & [ u8 ] ) -> bool {
13911392 radix <= 16 && digits. len ( ) <= mem:: size_of :: < T > ( ) * 2 - is_signed_ty as usize
13921393}
@@ -1410,6 +1411,7 @@ const fn from_str_radix_panic(radix: u32) {
14101411 intrinsics:: const_eval_select ( ( radix, ) , from_str_radix_panic_ct, from_str_radix_panic_rt) ;
14111412}
14121413
1414+ #[ allow_internal_unstable( const_int_cannot_overflow) ]
14131415macro_rules! from_str_radix {
14141416 ( $( $int_ty: ty) +) => { $(
14151417 impl $int_ty {
@@ -1436,7 +1438,7 @@ macro_rules! from_str_radix {
14361438 #[ doc = concat!( "assert_eq!(" , stringify!( $int_ty) , "::from_str_radix(\" A\" , 16), Ok(10));" ) ]
14371439 /// ```
14381440 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1439- #[ rustc_const_unstable ( feature = "const_int_from_str" , issue = "59133 " ) ]
1441+ #[ rustc_const_stable ( feature = "const_int_from_str" , since = "CURRENT_RUSTC_VERSION " ) ]
14401442 pub const fn from_str_radix( src: & str , radix: u32 ) -> Result <$int_ty, ParseIntError > {
14411443 use self :: IntErrorKind :: * ;
14421444 use self :: ParseIntError as PIE ;
@@ -1566,7 +1568,7 @@ macro_rules! from_str_radix_size_impl {
15661568 #[ doc = concat!( "assert_eq!(" , stringify!( $size) , "::from_str_radix(\" A\" , 16), Ok(10));" ) ]
15671569 /// ```
15681570 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1569- #[ rustc_const_unstable ( feature = "const_int_from_str" , issue = "59133 " ) ]
1571+ #[ rustc_const_stable ( feature = "const_int_from_str" , since = "CURRENT_RUSTC_VERSION " ) ]
15701572 pub const fn from_str_radix( src: & str , radix: u32 ) -> Result <$size, ParseIntError > {
15711573 match <$t>:: from_str_radix( src, radix) {
15721574 Ok ( x) => Ok ( x as $size) ,
0 commit comments