diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 11:42:07 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 11:42:07 +0100 |
commit | 7384c11750e9971770683861f7cd5f719c487ce9 (patch) | |
tree | 91bceba6b77ff84b04363a6976284df3023e8e9d /src/lib.rs | |
parent | 5c6f0d3510517d867c27e9a658e5015fb9b3d5ef (diff) |
refactor: make MethodError wrap TransformError
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -44,6 +44,7 @@ use crate::parse_trait_sig::SignatureChanges; use crate::parse_trait_sig::TypeTransform; use crate::syn_utils::iter_path; use crate::syn_utils::trait_bounds; +use crate::transform::TransformError; use crate::transform::TypeConverter; mod parse_assoc_type; @@ -95,7 +96,7 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { let mut signature = method.sig.clone(); match parse_trait_signature(&mut signature, &type_converter) { Err((_, MethodError::NonDispatchableMethod)) => continue, - Err((span, MethodError::AssocTypeWithoutDestType)) => { + Err((span, MethodError::Transform(TransformError::AssocTypeWithoutDestType))) => { return abort!( span, "associated type is either undefined or doesn't have a trait bound" @@ -107,7 +108,7 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { "dynamize does not support associated types in parameter types" ) } - Err((span, MethodError::UnsupportedType)) => { + Err((span, MethodError::Transform(TransformError::UnsupportedType))) => { return abort!(span, "dynamize does not know how to convert this type") } Err((span, MethodError::UnconvertedAssocType)) => { |