diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-22 11:31:48 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-22 11:31:48 +0100 |
commit | f4419ca138a5307a705decf70683414296dcf116 (patch) | |
tree | f4bb6cd5f66894d3507333402fa1b8f8e24a7870 /src/lib.rs | |
parent | 6b01f08fa1de6d67ab47ad19493ea683a75fc2ed (diff) |
simplify MethodError variants
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -95,7 +95,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::UnconvertibleAssocType)) => { + Err((span, MethodError::AssocTypeWithoutDestType)) => { return abort!( span, "associated type is either undefined or doesn't have a trait bound" @@ -107,16 +107,12 @@ pub fn dynamize(_attr: TokenStream, input: TokenStream) -> TokenStream { "dynamize does not support associated types in parameter types" ) } - Err(( - span, - MethodError::AssocTypeInUnsupportedReturnType - | MethodError::UnconvertibleAssocTypeInFnInput, - )) => return abort!(span, "dynamize does not know how to convert this type"), - Err(( - span, - MethodError::UnconvertibleAssocTypeInTraitBound - | MethodError::UnconvertibleAssocTypeInWhereClause, - )) => return abort!(span, "dynamize does not support associated types here"), + Err((span, MethodError::UnsupportedType)) => { + return abort!(span, "dynamize does not know how to convert this type") + } + Err((span, MethodError::UnconvertedAssocType)) => { + return abort!(span, "dynamize does not support associated types here") + } Err((span, MethodError::ImplTraitInInputs)) => { return abort!( span, |