diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -178,16 +178,14 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { let mut generic_map = HashMap::new(); - for generic in &dyn_trait.generics.params { - if let GenericParam::Type(type_param) = generic { - generic_map.insert(type_param.ident.clone(), type_param.bounds.clone()); - for trait_bound in trait_bounds(&type_param.bounds) { - if let Some(assoc_type) = find_in_path(&trait_bound.path, &AssocTypeMatcher) { - return abort!( - assoc_type.span(), - "dynamize does not support associated types in trait generic bounds" - ); - } + for type_param in dyn_trait.generics.type_params() { + generic_map.insert(type_param.ident.clone(), type_param.bounds.clone()); + for trait_bound in trait_bounds(&type_param.bounds) { + if let Some(assoc_type) = find_in_path(&trait_bound.path, &AssocTypeMatcher) { + return abort!( + assoc_type.span(), + "dynamize does not support associated types in trait generic bounds" + ); } } } |