@@ -15,9 +15,9 @@ use syn::{
15
15
parse_macro_input,
16
16
punctuated:: Punctuated ,
17
17
token:: { Comma , Plus } ,
18
- Error , FnArg , GenericParam , Generics , Ident , ItemTrait , Lifetime , Pat , PatType , Result ,
19
- ReturnType , Signature , Token , TraitBound , TraitItem , TraitItemConst , TraitItemFn ,
20
- TraitItemType , Type , TypeImplTrait , TypeParamBound ,
18
+ Error , FnArg , GenericParam , Ident , ItemTrait , Lifetime , Pat , PatType , Result , ReturnType ,
19
+ Signature , Token , TraitBound , TraitItem , TraitItemConst , TraitItemFn , TraitItemType , Type ,
20
+ TypeImplTrait , TypeParamBound ,
21
21
} ;
22
22
23
23
struct Attrs {
@@ -256,17 +256,11 @@ fn blanket_impl_item(
256
256
}
257
257
}
258
258
TraitItem :: Type ( TraitItemType {
259
- ident,
260
- generics :
261
- Generics {
262
- params,
263
- where_clause,
264
- ..
265
- } ,
266
- ..
259
+ ident, generics, ..
267
260
} ) => {
261
+ let ( impl_generics, ty_generics, where_clause) = generics. split_for_impl ( ) ;
268
262
quote ! {
269
- type #ident<#params> = <Self as #variant<#generic_names>>:: #ident<#params> #where_clause;
263
+ type #ident #impl_generics = <Self as #variant<#generic_names>>:: #ident #ty_generics #where_clause;
270
264
}
271
265
}
272
266
_ => Error :: new_spanned ( item, "unsupported item type" ) . into_compile_error ( ) ,
0 commit comments