[wasm] Have the WasmError::User member be a String;
This commit is contained in:
@@ -27,7 +27,7 @@ target-lexicon = "0.4.0"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
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"]
|
core = ["hashmap_core", "cranelift-codegen/core", "cranelift-frontend/core", "wasmparser/core"]
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
|
|||||||
@@ -68,17 +68,9 @@ pub enum WasmError {
|
|||||||
#[fail(display = "Implementation limit exceeded")]
|
#[fail(display = "Implementation limit exceeded")]
|
||||||
ImplLimitExceeded,
|
ImplLimitExceeded,
|
||||||
|
|
||||||
/// Any user-defined error. Requires an std build, where failure::Error is defined.
|
/// Any user-defined error.
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[fail(display = "User error: {}", _0)]
|
#[fail(display = "User error: {}", _0)]
|
||||||
User(failure::Error),
|
User(std::string::String),
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl From<failure::Error> for WasmError {
|
|
||||||
fn from(err: failure::Error) -> Self {
|
|
||||||
WasmError::User(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<BinaryReaderError> for WasmError {
|
impl From<BinaryReaderError> for WasmError {
|
||||||
|
|||||||
Reference in New Issue
Block a user