@@ -91,6 +91,20 @@ fn make_variant(attrs: &Attrs, tr: &ItemTrait) -> TokenStream {
91
91
}
92
92
93
93
fn transform_item ( item : & TraitItem , bounds : & Vec < TypeParamBound > ) -> TraitItem {
94
+ // #[variant(SendIntFactory: Send)]
95
+ // trait IntFactory {
96
+ // async fn make(&self, x: u32, y: &str) -> i32;
97
+ // fn stream(&self) -> impl Iterator<Item = i32>;
98
+ // fn call(&self) -> u32;
99
+ // }
100
+ //
101
+ // becomes:
102
+ //
103
+ // trait SendIntFactory: Send {
104
+ // fn make(&self, x: u32, y: &str) -> impl ::core::future::Future<Output = i32> + Send;
105
+ // fn stream(&self) -> impl Iterator<Item = i32> + Send;
106
+ // fn call(&self) -> u32;
107
+ // }
94
108
let TraitItem :: Fn ( fn_item @ TraitItemFn { sig, .. } ) = item else {
95
109
return item. clone ( ) ;
96
110
} ;
@@ -144,6 +158,13 @@ fn make_blanket_impl(attrs: &Attrs, tr: &ItemTrait) -> TokenStream {
144
158
}
145
159
146
160
fn blanket_impl_item ( item : & TraitItem , variant : & Ident ) -> TokenStream {
161
+ // impl<T> IntFactory for T where T: SendIntFactory {
162
+ // const NAME: &'static str = <Self as SendIntFactory>::NAME;
163
+ // type MyFut<'a> = <Self as SendIntFactory>::MyFut<'a> where Self: 'a;
164
+ // async fn make(&self, x: u32, y: &str) -> i32 {
165
+ // <Self as SendIntFactory>::make(self, x, y).await
166
+ // }
167
+ // }
147
168
match item {
148
169
TraitItem :: Const ( TraitItemConst {
149
170
ident,
0 commit comments