@@ -192,21 +192,29 @@ fn transform_sig(
192
192
Some ( colon_token) => colon_token. span ,
193
193
None => param_name. span ( ) ,
194
194
} ;
195
- let bounds = mem:: take ( & mut param. bounds ) ;
196
- where_clause_or_default ( & mut sig. generics . where_clause )
197
- . predicates
198
- . push ( parse_quote_spanned ! ( span=> #param_name: ' async_trait + #bounds) ) ;
195
+ if param. attrs . is_empty ( ) {
196
+ let bounds = mem:: take ( & mut param. bounds ) ;
197
+ where_clause_or_default ( & mut sig. generics . where_clause )
198
+ . predicates
199
+ . push ( parse_quote_spanned ! ( span=> #param_name: ' async_trait + #bounds) ) ;
200
+ } else {
201
+ param. bounds . push ( parse_quote ! ( ' async_trait) ) ;
202
+ }
199
203
}
200
204
GenericParam :: Lifetime ( param) => {
201
205
let param_name = & param. lifetime ;
202
206
let span = match param. colon_token . take ( ) {
203
207
Some ( colon_token) => colon_token. span ,
204
208
None => param_name. span ( ) ,
205
209
} ;
206
- let bounds = mem:: take ( & mut param. bounds ) ;
207
- where_clause_or_default ( & mut sig. generics . where_clause )
208
- . predicates
209
- . push ( parse_quote_spanned ! ( span=> #param: ' async_trait + #bounds) ) ;
210
+ if param. attrs . is_empty ( ) {
211
+ let bounds = mem:: take ( & mut param. bounds ) ;
212
+ where_clause_or_default ( & mut sig. generics . where_clause )
213
+ . predicates
214
+ . push ( parse_quote_spanned ! ( span=> #param: ' async_trait + #bounds) ) ;
215
+ } else {
216
+ param. bounds . push ( parse_quote ! ( ' async_trait) ) ;
217
+ }
210
218
}
211
219
GenericParam :: Const ( _) => { }
212
220
}
0 commit comments