about summary refs log tree commit diff
path: root/library/core/src/num
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/num')
-rw-r--r--library/core/src/num/error.rs6
-rw-r--r--library/core/src/num/mod.rs3
-rw-r--r--library/core/src/num/nonzero.rs3
3 files changed, 8 insertions, 4 deletions
diff --git a/library/core/src/num/error.rs b/library/core/src/num/error.rs
index f9c4cdd0ebe..cfedd465cab 100644
--- a/library/core/src/num/error.rs
+++ b/library/core/src/num/error.rs
@@ -26,14 +26,16 @@ impl Error for TryFromIntError {
 }
 
 #[stable(feature = "try_from", since = "1.34.0")]
-impl From<Infallible> for TryFromIntError {
+#[rustc_const_unstable(feature = "const_try", issue = "74935")]
+impl const From<Infallible> for TryFromIntError {
     fn from(x: Infallible) -> TryFromIntError {
         match x {}
     }
 }
 
 #[unstable(feature = "never_type", issue = "35121")]
-impl From<!> for TryFromIntError {
+#[rustc_const_unstable(feature = "const_try", issue = "74935")]
+impl const From<!> for TryFromIntError {
     #[inline]
     fn from(never: !) -> TryFromIntError {
         // Match rather than coerce to make sure that code like
diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs
index faa41ddf13c..acfe38b7a37 100644
--- a/library/core/src/num/mod.rs
+++ b/library/core/src/num/mod.rs
@@ -1378,7 +1378,8 @@ const fn from_ascii_radix_panic(radix: u32) -> ! {
 macro_rules! from_str_int_impl {
     ($signedness:ident $($int_ty:ty)+) => {$(
         #[stable(feature = "rust1", since = "1.0.0")]
-        impl FromStr for $int_ty {
+        #[rustc_const_unstable(feature = "const_try", issue = "74935")]
+        impl const FromStr for $int_ty {
             type Err = ParseIntError;
 
             /// Parses an integer from a string slice with decimal digits.
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs
index b8900c4113a..f793602de50 100644
--- a/library/core/src/num/nonzero.rs
+++ b/library/core/src/num/nonzero.rs
@@ -297,7 +297,8 @@ where
 }
 
 #[stable(feature = "from_nonzero", since = "1.31.0")]
-impl<T> From<NonZero<T>> for T
+#[rustc_const_unstable(feature = "const_try", issue = "74935")]
+impl<T> const From<NonZero<T>> for T
 where
     T: ZeroablePrimitive,
 {