delete GuestErrorConversion from docs, tests

This commit is contained in:
Pat Hickey
2021-03-23 22:20:29 -07:00
parent f74b0291ad
commit 1c4af27f2d
15 changed files with 16 additions and 66 deletions

View File

@@ -27,10 +27,6 @@ witx_literal: "
errors: { errno => RichError },
});
// The impl of GuestErrorConversion works just like in every other test where
// we have a single error type with witx `$errno` with the success called `$ok`
impl_errno!(types::Errno, types::GuestErrorConversion);
/// When the `errors` mapping in witx is non-empty, we need to impl the
/// types::UserErrorConversion trait that wiggle generates from that mapping.
impl<'a> types::UserErrorConversion for WasiCtx<'a> {

View File

@@ -347,18 +347,11 @@ impl<'a> WasiCtx<'a> {
// with these errors. We just push them to vecs.
#[macro_export]
macro_rules! impl_errno {
( $errno:ty, $convert:path ) => {
( $errno:ty ) => {
impl wiggle::GuestErrorType for $errno {
fn success() -> $errno {
<$errno>::Ok
}
}
impl<'a> $convert for WasiCtx<'a> {
fn into_errno(&self, e: wiggle::GuestError) -> $errno {
eprintln!("GuestError: {:?}", e);
self.guest_errors.borrow_mut().push(e);
<$errno>::InvalidArg
}
}
};
}