@@ -69,21 +69,20 @@ macro_rules! impl_from {
69
69
) ,
70
70
) ;
71
71
} ;
72
- ( $Small: ty => $Large: ty, #[ $attr: meta] $( , # [ $flux_attr : meta ] ) ? $ ( , ) ?) => {
72
+ ( $Small: ty => $Large: ty, #[ $attr: meta] $( , ) ?) => {
73
73
impl_from!(
74
74
$Small => $Large,
75
75
#[ $attr] ,
76
76
concat!( "Converts [`" , stringify!( $Small) , "`] to [`" , stringify!( $Large) , "`] losslessly." ) ,
77
- $( #[ $flux_attr] , ) ?
78
77
) ;
79
78
} ;
80
- ( $Small: ty => $Large: ty, #[ $attr: meta] , $doc: expr $( , # [ $flux_attr : meta ] ) ? $ ( , ) ?) => {
79
+ ( $Small: ty => $Large: ty, #[ $attr: meta] , $doc: expr $( , ) ?) => {
81
80
#[ $attr]
82
81
impl From <$Small> for $Large {
83
82
// Rustdocs on the impl block show a "[+] show undocumented items" toggle.
84
83
// Rustdocs on functions do not.
85
84
#[ doc = $doc]
86
- $ ( # [ $flux_attr ] ) ?
85
+ # [ cfg_attr ( flux , flux :: spec ( fn ( small : $Small ) -> $Large [ cast ( small ) ] ) ) ]
87
86
#[ inline( always) ]
88
87
fn from( small: $Small) -> Self {
89
88
small as Self
@@ -111,7 +110,7 @@ impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")])
111
110
impl_from ! ( u8 => u32 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
112
111
impl_from ! ( u8 => u64 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
113
112
impl_from ! ( u8 => u128 , #[ stable( feature = "i128" , since = "1.26.0" ) ] ) ;
114
- impl_from ! ( u8 => usize , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] , # [ cfg_attr ( flux , flux :: spec ( fn ( x : u8 ) -> usize [ x ] ) ) ] ) ;
113
+ impl_from ! ( u8 => usize , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
115
114
impl_from ! ( u16 => u32 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
116
115
impl_from ! ( u16 => u64 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
117
116
impl_from ! ( u16 => u128 , #[ stable( feature = "i128" , since = "1.26.0" ) ] ) ;
0 commit comments