@@ -69,19 +69,21 @@ macro_rules! impl_from {
6969 ) ,
7070 ) ;
7171 } ;
72- ( $Small: ty => $Large: ty, #[ $attr: meta] $( , ) ?) => {
72+ ( $Small: ty => $Large: ty, #[ $attr: meta] $( , # [ $flux_attr : meta ] ) ? $ ( , ) ?) => {
7373 impl_from!(
7474 $Small => $Large,
7575 #[ $attr] ,
7676 concat!( "Converts [`" , stringify!( $Small) , "`] to [`" , stringify!( $Large) , "`] losslessly." ) ,
77+ $( #[ $flux_attr] , ) ?
7778 ) ;
7879 } ;
79- ( $Small: ty => $Large: ty, #[ $attr: meta] , $doc: expr $( , ) ?) => {
80+ ( $Small: ty => $Large: ty, #[ $attr: meta] , $doc: expr $( , # [ $flux_attr : meta ] ) ? $ ( , ) ?) => {
8081 #[ $attr]
8182 impl From <$Small> for $Large {
8283 // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
8384 // Rustdocs on functions do not.
8485 #[ doc = $doc]
86+ $( #[ $flux_attr] ) ?
8587 #[ inline( always) ]
8688 fn from( small: $Small) -> Self {
8789 small as Self
@@ -109,7 +111,7 @@ impl_from!(u8 => u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")])
109111impl_from ! ( u8 => u32 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
110112impl_from ! ( u8 => u64 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
111113impl_from ! ( u8 => u128 , #[ stable( feature = "i128" , since = "1.26.0" ) ] ) ;
112- impl_from ! ( u8 => usize , #[ stable( feature = "lossless_int_conv" , since = "1.5.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 ] ) ) ] ) ;
113115impl_from ! ( u16 => u32 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
114116impl_from ! ( u16 => u64 , #[ stable( feature = "lossless_int_conv" , since = "1.5.0" ) ] ) ;
115117impl_from ! ( u16 => u128 , #[ stable( feature = "i128" , since = "1.26.0" ) ] ) ;
0 commit comments