@@ -2682,8 +2682,8 @@ pub use num::dec2flt::ParseFloatError;
26822682// Conversions T -> T are covered by a blanket impl and therefore excluded
26832683// Some conversions from and to usize/isize are not implemented due to portability concerns
26842684macro_rules! impl_from {
2685- ( $Small: ty, $Large: ty) => {
2686- #[ stable ( feature = "lossless_prim_conv" , since = "1.5.0" ) ]
2685+ ( $Small: ty, $Large: ty, # [ $attr : meta ] ) => {
2686+ #[ $attr ]
26872687 impl From <$Small> for $Large {
26882688 #[ inline]
26892689 fn from( small: $Small) -> $Large {
@@ -2694,60 +2694,60 @@ macro_rules! impl_from {
26942694}
26952695
26962696// Unsigned -> Unsigned
2697- impl_from ! { u8 , u16 }
2698- impl_from ! { u8 , u32 }
2699- impl_from ! { u8 , u64 }
2700- impl_from ! { u8 , u128 }
2701- impl_from ! { u8 , usize }
2702- impl_from ! { u16 , u32 }
2703- impl_from ! { u16 , u64 }
2704- impl_from ! { u16 , u128 }
2705- impl_from ! { u32 , u64 }
2706- impl_from ! { u32 , u128 }
2707- impl_from ! { u64 , u128 }
2697+ impl_from ! { u8 , u16 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2698+ impl_from ! { u8 , u32 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2699+ impl_from ! { u8 , u64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2700+ impl_from ! { u8 , u128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2701+ impl_from ! { u8 , usize , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2702+ impl_from ! { u16 , u32 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2703+ impl_from ! { u16 , u64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2704+ impl_from ! { u16 , u128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2705+ impl_from ! { u32 , u64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2706+ impl_from ! { u32 , u128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2707+ impl_from ! { u64 , u128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
27082708
27092709// Signed -> Signed
2710- impl_from ! { i8 , i16 }
2711- impl_from ! { i8 , i32 }
2712- impl_from ! { i8 , i64 }
2713- impl_from ! { i8 , i128 }
2714- impl_from ! { i8 , isize }
2715- impl_from ! { i16 , i32 }
2716- impl_from ! { i16 , i64 }
2717- impl_from ! { i16 , i128 }
2718- impl_from ! { i32 , i64 }
2719- impl_from ! { i32 , i128 }
2720- impl_from ! { i64 , i128 }
2710+ impl_from ! { i8 , i16 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2711+ impl_from ! { i8 , i32 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2712+ impl_from ! { i8 , i64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2713+ impl_from ! { i8 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2714+ impl_from ! { i8 , isize , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2715+ impl_from ! { i16 , i32 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2716+ impl_from ! { i16 , i64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2717+ impl_from ! { i16 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2718+ impl_from ! { i32 , i64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2719+ impl_from ! { i32 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2720+ impl_from ! { i64 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
27212721
27222722// Unsigned -> Signed
2723- impl_from ! { u8 , i16 }
2724- impl_from ! { u8 , i32 }
2725- impl_from ! { u8 , i64 }
2726- impl_from ! { u8 , i128 }
2727- impl_from ! { u16 , i32 }
2728- impl_from ! { u16 , i64 }
2729- impl_from ! { u16 , i128 }
2730- impl_from ! { u32 , i64 }
2731- impl_from ! { u32 , i128 }
2732- impl_from ! { u64 , i128 }
2723+ impl_from ! { u8 , i16 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2724+ impl_from ! { u8 , i32 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2725+ impl_from ! { u8 , i64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2726+ impl_from ! { u8 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2727+ impl_from ! { u16 , i32 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2728+ impl_from ! { u16 , i64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2729+ impl_from ! { u16 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2730+ impl_from ! { u32 , i64 , # [ stable ( feature = "lossless_int_conv" , since = "1.5.0" ) ] }
2731+ impl_from ! { u32 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
2732+ impl_from ! { u64 , i128 , # [ unstable ( feature = "i128" , issue = "35118" ) ] }
27332733
27342734// Note: integers can only be represented with full precision in a float if
27352735// they fit in the significand, which is 24 bits in f32 and 53 bits in f64.
27362736// Lossy float conversions are not implemented at this time.
27372737
27382738// Signed -> Float
2739- impl_from ! { i8 , f32 }
2740- impl_from ! { i8 , f64 }
2741- impl_from ! { i16 , f32 }
2742- impl_from ! { i16 , f64 }
2743- impl_from ! { i32 , f64 }
2739+ impl_from ! { i8 , f32 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2740+ impl_from ! { i8 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2741+ impl_from ! { i16 , f32 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2742+ impl_from ! { i16 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2743+ impl_from ! { i32 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
27442744
27452745// Unsigned -> Float
2746- impl_from ! { u8 , f32 }
2747- impl_from ! { u8 , f64 }
2748- impl_from ! { u16 , f32 }
2749- impl_from ! { u16 , f64 }
2750- impl_from ! { u32 , f64 }
2746+ impl_from ! { u8 , f32 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2747+ impl_from ! { u8 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2748+ impl_from ! { u16 , f32 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2749+ impl_from ! { u16 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
2750+ impl_from ! { u32 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
27512751
27522752// Float -> Float
2753- impl_from ! { f32 , f64 }
2753+ impl_from ! { f32 , f64 , # [ stable ( feature = "lossless_float_conv" , since = "1.6.0" ) ] }
0 commit comments