Skip to content

Commit

Permalink
mark can_not_overflow as #[rustc_const_stable(...)]
Browse files Browse the repository at this point in the history
  • Loading branch information
Skgland committed Jul 4, 2024
1 parent 133867d commit 8da2028
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ from_str_radix_int_impl! { isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128 }
#[doc(hidden)]
#[inline(always)]
#[unstable(issue = "none", feature = "std_internals")]
#[rustc_const_unstable(issue = "none", feature = "const_int_cannot_overflow")]
#[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")]
pub const fn can_not_overflow<T>(radix: u32, is_signed_ty: bool, digits: &[u8]) -> bool {
radix <= 16 && digits.len() <= mem::size_of::<T>() * 2 - is_signed_ty as usize
}
Expand All @@ -1420,7 +1420,6 @@ const fn from_str_radix_assert(radix: u32) {
}
}

#[allow_internal_unstable(const_int_cannot_overflow)]
macro_rules! from_str_radix {
($($int_ty:ty)+) => {$(
impl $int_ty {
Expand Down

0 comments on commit 8da2028

Please sign in to comment.