diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2023-12-12 10:09:38 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2023-12-12 10:09:38 +0100 |
| commit | 97fb3cc56442c4d831ef2c9e1599cc8105ff2b96 (patch) | |
| tree | 2f62d90956cfa39490112a93d8ba9bb41c6b8577 /crates/parser/src/error.rs | |
| parent | 1663131fb135abf96e4e68a5f872d5cb282ec5e5 (diff) | |
test(tinywasm): add AssertReturn to spec test harness
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/error.rs')
| -rw-r--r-- | crates/parser/src/error.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/parser/src/error.rs b/crates/parser/src/error.rs index a5c807a..acacfa0 100644 --- a/crates/parser/src/error.rs +++ b/crates/parser/src/error.rs @@ -1,8 +1,9 @@ -use core::fmt::Debug; +use core::fmt::{Debug, Display}; use alloc::string::{String, ToString}; use wasmparser::Encoding; +#[derive(Debug)] pub enum ParseError { InvalidType, UnsupportedSection(String), @@ -16,7 +17,7 @@ pub enum ParseError { Other(String), } -impl Debug for ParseError { +impl Display for ParseError { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { Self::InvalidType => write!(f, "invalid type"), @@ -37,6 +38,9 @@ impl Debug for ParseError { } } +#[cfg(any(feature = "std", all(not(feature = "std"), nightly)))] +impl crate::std::error::Error for ParseError {} + impl From<wasmparser::BinaryReaderError> for ParseError { fn from(value: wasmparser::BinaryReaderError) -> Self { Self::ParseError { |
