diff --git a/lib/compiler/src/error.rs b/lib/compiler/src/error.rs index d71af061674..0d554c15e8c 100644 --- a/lib/compiler/src/error.rs +++ b/lib/compiler/src/error.rs @@ -18,7 +18,7 @@ use thiserror::Error; pub enum CompileError { /// A Wasm translation error occured. #[cfg_attr(feature = "std", error("WebAssembly translation error: {0}"))] - Wasm(#[cfg_attr(feature = "std", from)] WasmError), + Wasm(WasmError), /// A compilation error occured. #[cfg_attr(feature = "std", error("Compilation error: {0}"))] @@ -42,6 +42,12 @@ pub enum CompileError { Resource(String), } +impl From for CompileError { + fn from(original: WasmError) -> Self { + Self::Wasm(original) + } +} + /// A WebAssembly translation error. /// /// When a WebAssembly function can't be translated, one of these error codes will be returned