disable std::error in no_std
This commit is contained in:
parent
f4173ad8ca
commit
33a0e6ec4c
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
@ -11,6 +12,7 @@ impl fmt::Display for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
impl error::Error for Error {
|
impl error::Error for Error {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
&self.0
|
&self.0
|
||||||
|
|
|
@ -110,6 +110,7 @@ extern crate memory_units as memory_units_crate;
|
||||||
pub extern crate nan_preserving_float;
|
pub extern crate nan_preserving_float;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
#[cfg(feature = "std")]
|
||||||
use std::error;
|
use std::error;
|
||||||
|
|
||||||
/// Error type which can be thrown by wasm code or by host environment.
|
/// Error type which can be thrown by wasm code or by host environment.
|
||||||
|
@ -139,6 +140,7 @@ impl fmt::Display for Trap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
impl error::Error for Trap {
|
impl error::Error for Trap {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
"runtime trap"
|
"runtime trap"
|
||||||
|
@ -309,6 +311,7 @@ impl fmt::Display for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
impl error::Error for Error {
|
impl error::Error for Error {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match *self {
|
match *self {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#[cfg(feature = "std")]
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use hashmap_core::HashSet;
|
use hashmap_core::HashSet;
|
||||||
|
@ -27,6 +28,7 @@ impl fmt::Display for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
impl error::Error for Error {
|
impl error::Error for Error {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
&self.0
|
&self.0
|
||||||
|
|
Loading…
Reference in New Issue