@@ -43,27 +43,17 @@ use crate::hash::Hasher;
43
43
/// ```
44
44
#[ unstable( feature = "internal_impls_macro" , issue = "none" ) ]
45
45
macro marker_impls {
46
- ( $( #[ $( $meta: tt) * ] ) * $Trait: ident for $( $( { $( $bounds: tt) * } ) ? $T: ty ) , + $( , ) ?) => {
47
- // This inner macro is needed because... idk macros are weird.
48
- // It allows repeating `meta` on all impls.
49
- #[ unstable( feature = "internal_impls_macro" , issue = "none" ) ]
50
- macro _impl {
51
- ( $$( { $$( $$bounds_: tt) * } ) ? $$T_: ty ) => {
52
- $( #[ $( $meta) * ] ) * impl<$$( $$( $$bounds_) * ) ?> $Trait for $$T_ { }
53
- }
54
- }
55
- $( _impl ! { $( { $( $bounds) * } ) ? $T } ) +
46
+ ( $( #[ $( $meta: tt) * ] ) * $Trait: ident for $( { $( $bounds: tt) * } ) ? $T: ty $( , $( $rest: tt) * ) ? ) => {
47
+ $( #[ $( $meta) * ] ) * impl< $( $( $bounds) * ) ? > $Trait for $T { }
48
+ marker_impls ! { $( #[ $( $meta) * ] ) * $Trait for $( $( $rest) * ) ? }
56
49
} ,
57
- ( $( #[ $( $meta: tt) * ] ) * unsafe $Trait: ident for $( $( { $( $bounds: tt) * } ) ? $T: ty ) , + $( , ) ?) => {
58
- #[ unstable( feature = "internal_impls_macro" , issue = "none" ) ]
59
- macro _impl {
60
- ( $$( { $$( $$bounds_: tt) * } ) ? $$T_: ty ) => {
61
- $( #[ $( $meta) * ] ) * unsafe impl <$$( $$( $$bounds_) * ) ?> $Trait for $$T_ { }
62
- }
63
- }
50
+ ( $( #[ $( $meta: tt) * ] ) * $Trait: ident for ) => { } ,
64
51
65
- $( _impl ! { $( { $( $bounds) * } ) ? $T } ) +
52
+ ( $( #[ $( $meta: tt) * ] ) * unsafe $Trait: ident for $( { $( $bounds: tt) * } ) ? $T: ty $( , $( $rest: tt) * ) ? ) => {
53
+ $( #[ $( $meta) * ] ) * unsafe impl< $( $( $bounds) * ) ? > $Trait for $T { }
54
+ marker_impls ! { $( #[ $( $meta) * ] ) * unsafe $Trait for $( $( $rest) * ) ? }
66
55
} ,
56
+ ( $( #[ $( $meta: tt) * ] ) * unsafe $Trait: ident for ) => { } ,
67
57
}
68
58
69
59
/// Types that can be transferred across thread boundaries.
0 commit comments