aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 99abfdb..abeab4c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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"
+ );
+ }
+ }
}
}