diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -43,6 +43,8 @@ use crate::parse_trait_sig::parse_trait_signature; use crate::parse_trait_sig::MethodParseError; use crate::parse_trait_sig::SignatureChanges; use crate::parse_trait_sig::TypeTransform; +use crate::syn_utils::find_in_path; +use crate::syn_utils::trait_bounds; use crate::transform::AssocTypeConversions; mod parse_assoc_type; @@ -179,6 +181,14 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { 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" + ); + } + } } } |