[wasm] Have the WasmError::User member be a String;

This commit is contained in:
Benjamin Bouvier
2019-05-03 15:38:28 +02:00
parent 8f95c51730
commit a0ddbf403c
2 changed files with 3 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ target-lexicon = "0.4.0"
[features]
default = ["std"]
std = ["cranelift-codegen/std", "cranelift-frontend/std", "wasmparser/std", "failure/std"]
std = ["cranelift-codegen/std", "cranelift-frontend/std", "wasmparser/std"]
core = ["hashmap_core", "cranelift-codegen/core", "cranelift-frontend/core", "wasmparser/core"]
[badges]

View File

@@ -68,17 +68,9 @@ pub enum WasmError {
#[fail(display = "Implementation limit exceeded")]
ImplLimitExceeded,
/// Any user-defined error. Requires an std build, where failure::Error is defined.
#[cfg(feature = "std")]
/// Any user-defined error.
#[fail(display = "User error: {}", _0)]
User(failure::Error),
}
#[cfg(feature = "std")]
impl From<failure::Error> for WasmError {
fn from(err: failure::Error) -> Self {
WasmError::User(err)
}
User(std::string::String),
}
impl From<BinaryReaderError> for WasmError {