From b855184ae18e59107455aea11710c0aa74637d71 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 22 May 2018 09:37:33 -0700 Subject: [PATCH] Make WasmError and WasmResult public types. --- lib/wasm/src/environ/spec.rs | 2 ++ lib/wasm/src/lib.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index 6093203ff2..5b26ca785f 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -35,7 +35,9 @@ pub enum WasmError { /// code. This should never happen for validated WebAssembly code. #[fail(display = "Invalid input WebAssembly code at offset {}: {}", _1, _0)] InvalidWebAssembly { + /// A string describing the validation error. message: &'static str, + /// The bytecode offset where the error occurred. offset: usize, }, diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index 6fe32541e2..87d1d87ee2 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -53,7 +53,8 @@ mod sections_translator; mod state; mod translation_utils; -pub use environ::{DummyEnvironment, FuncEnvironment, GlobalValue, ModuleEnvironment}; +pub use environ::{DummyEnvironment, FuncEnvironment, GlobalValue, ModuleEnvironment, WasmError, + WasmResult}; pub use func_translator::FuncTranslator; pub use module_translator::translate_module; pub use translation_utils::{FunctionIndex, Global, GlobalIndex, GlobalInit, Memory, MemoryIndex,