@@ -45,7 +45,8 @@ impl_float_to_int!(f64 => u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize);
4545macro_rules! impl_from {
4646 ( $Small: ty, $Large: ty, #[ $attr: meta] , $doc: expr) => {
4747 #[ $attr]
48- impl From <$Small> for $Large {
48+ #[ rustc_const_unstable( feature = "const_num_from_num" , issue = "87852" ) ]
49+ impl const From <$Small> for $Large {
4950 // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
5051 // Rustdocs on functions do not.
5152 #[ doc = $doc]
@@ -172,7 +173,8 @@ impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0"
172173macro_rules! try_from_unbounded {
173174 ( $source: ty, $( $target: ty) ,* ) => { $(
174175 #[ stable( feature = "try_from" , since = "1.34.0" ) ]
175- impl TryFrom <$source> for $target {
176+ #[ rustc_const_unstable( feature = "const_num_from_num" , issue = "87852" ) ]
177+ impl const TryFrom <$source> for $target {
176178 type Error = TryFromIntError ;
177179
178180 /// Try to create the target number type from a source
@@ -190,7 +192,8 @@ macro_rules! try_from_unbounded {
190192macro_rules! try_from_lower_bounded {
191193 ( $source: ty, $( $target: ty) ,* ) => { $(
192194 #[ stable( feature = "try_from" , since = "1.34.0" ) ]
193- impl TryFrom <$source> for $target {
195+ #[ rustc_const_unstable( feature = "const_num_from_num" , issue = "87852" ) ]
196+ impl const TryFrom <$source> for $target {
194197 type Error = TryFromIntError ;
195198
196199 /// Try to create the target number type from a source
@@ -212,7 +215,8 @@ macro_rules! try_from_lower_bounded {
212215macro_rules! try_from_upper_bounded {
213216 ( $source: ty, $( $target: ty) ,* ) => { $(
214217 #[ stable( feature = "try_from" , since = "1.34.0" ) ]
215- impl TryFrom <$source> for $target {
218+ #[ rustc_const_unstable( feature = "const_num_from_num" , issue = "87852" ) ]
219+ impl const TryFrom <$source> for $target {
216220 type Error = TryFromIntError ;
217221
218222 /// Try to create the target number type from a source
@@ -234,7 +238,8 @@ macro_rules! try_from_upper_bounded {
234238macro_rules! try_from_both_bounded {
235239 ( $source: ty, $( $target: ty) ,* ) => { $(
236240 #[ stable( feature = "try_from" , since = "1.34.0" ) ]
237- impl TryFrom <$source> for $target {
241+ #[ rustc_const_unstable( feature = "const_num_from_num" , issue = "87852" ) ]
242+ impl const TryFrom <$source> for $target {
238243 type Error = TryFromIntError ;
239244
240245 /// Try to create the target number type from a source
0 commit comments