@@ -192,21 +192,29 @@ fn transform_sig(
192192 Some ( colon_token) => colon_token. span ,
193193 None => param_name. span ( ) ,
194194 } ;
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+ }
199203 }
200204 GenericParam :: Lifetime ( param) => {
201205 let param_name = & param. lifetime ;
202206 let span = match param. colon_token . take ( ) {
203207 Some ( colon_token) => colon_token. span ,
204208 None => param_name. span ( ) ,
205209 } ;
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+ }
210218 }
211219 GenericParam :: Const ( _) => { }
212220 }
0 commit comments