aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-22 11:31:48 +0100
committerMartin Fischer <martin@push-f.com>2021-11-22 11:31:48 +0100
commitf4419ca138a5307a705decf70683414296dcf116 (patch)
treef4bb6cd5f66894d3507333402fa1b8f8e24a7870 /src/lib.rs
parent6b01f08fa1de6d67ab47ad19493ea683a75fc2ed (diff)
simplify MethodError variants
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b46bcad..1fd5988 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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,