From e6c7e00a5220b48c6d23b9ffd38078dc103775a5 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 24 Mar 2021 10:39:06 -0700 Subject: [PATCH] wiggle-using crates: delete GuestErrorConversion --- crates/wasi-common/src/snapshots/preview_0.rs | 8 -------- crates/wasi-common/src/snapshots/preview_1.rs | 7 ------- crates/wasi-crypto/src/wiggle_interfaces/error.rs | 7 ------- crates/wasi-nn/src/witx.rs | 10 ---------- 4 files changed, 32 deletions(-) diff --git a/crates/wasi-common/src/snapshots/preview_0.rs b/crates/wasi-common/src/snapshots/preview_0.rs index 909c228599..02e6289cd2 100644 --- a/crates/wasi-common/src/snapshots/preview_0.rs +++ b/crates/wasi-common/src/snapshots/preview_0.rs @@ -24,14 +24,6 @@ impl wiggle::GuestErrorType for types::Errno { } } -impl types::GuestErrorConversion for WasiCtx { - fn into_errno(&self, e: wiggle::GuestError) -> types::Errno { - debug!("Guest error: {:?}", e); - let snapshot1_errno: snapshot1_types::Errno = e.into(); - snapshot1_errno.into() - } -} - impl types::UserErrorConversion for WasiCtx { fn errno_from_error(&self, e: Error) -> Result { debug!("Error: {:?}", e); diff --git a/crates/wasi-common/src/snapshots/preview_1.rs b/crates/wasi-common/src/snapshots/preview_1.rs index c451856207..494ba9111e 100644 --- a/crates/wasi-common/src/snapshots/preview_1.rs +++ b/crates/wasi-common/src/snapshots/preview_1.rs @@ -30,13 +30,6 @@ impl wiggle::GuestErrorType for types::Errno { } } -impl types::GuestErrorConversion for WasiCtx { - fn into_errno(&self, e: wiggle::GuestError) -> types::Errno { - debug!("Guest error: {:?}", e); - e.into() - } -} - impl types::UserErrorConversion for WasiCtx { fn errno_from_error(&self, e: Error) -> Result { debug!("Error: {:?}", e); diff --git a/crates/wasi-crypto/src/wiggle_interfaces/error.rs b/crates/wasi-crypto/src/wiggle_interfaces/error.rs index e3651f6db9..fd13a87331 100644 --- a/crates/wasi-crypto/src/wiggle_interfaces/error.rs +++ b/crates/wasi-crypto/src/wiggle_interfaces/error.rs @@ -52,13 +52,6 @@ impl<'a> wiggle::GuestErrorType for guest_types::CryptoErrno { } } -impl guest_types::GuestErrorConversion for WasiCryptoCtx { - fn into_crypto_errno(&self, e: wiggle::GuestError) -> guest_types::CryptoErrno { - eprintln!("GuestError (witx) {:?}", e); - guest_types::CryptoErrno::GuestError - } -} - impl From for guest_types::CryptoErrno { fn from(e: wiggle::GuestError) -> Self { eprintln!("GuestError (impl) {:?}", e); diff --git a/crates/wasi-nn/src/witx.rs b/crates/wasi-nn/src/witx.rs index 72120276b7..32cc0167d8 100644 --- a/crates/wasi-nn/src/witx.rs +++ b/crates/wasi-nn/src/witx.rs @@ -10,16 +10,6 @@ wiggle::from_witx!({ use types::NnErrno; -/// Wiggle generates code that performs some input validation on the arguments passed in by users of -/// wasi-nn. Here we convert the validation error into one (or more, eventually) of the error -/// variants defined in the witx. -impl types::GuestErrorConversion for WasiNnCtx { - fn into_nn_errno(&self, e: wiggle::GuestError) -> NnErrno { - eprintln!("Guest error: {:?}", e); - NnErrno::InvalidArgument - } -} - impl<'a> types::UserErrorConversion for WasiNnCtx { fn nn_errno_from_wasi_nn_error(&self, e: WasiNnError) -> Result { eprintln!("Host error: {:?}", e);