GuestErrorType only needs to have a success constructor

This commit is contained in:
Pat Hickey
2020-03-27 14:31:59 -07:00
parent 9ca3bf532e
commit 167a040ea5
5 changed files with 12 additions and 27 deletions

View File

@@ -60,7 +60,7 @@ pub fn define_func(names: &Names, func: &witx::InterfaceFunc) -> TokenStream {
let err_typename = names.type_ref(&tref, anon_lifetime());
quote! {
let e = wiggle::GuestError::InFunc { funcname: #funcname, location: #location, err: Box::new(e.into()) };
let err: #err_typename = wiggle::GuestErrorType::from_error(e, ctx);
let err: #err_typename = wiggle::GuestErrorType::from_error(e, ctx); // XXX replace with conversion method on trait!
return #abi_ret::from(err);
}
} else {