* Make more code work with no_std. no_std support is still incomplete, but this patch takes care of the bulk of the straightforward parts.
22 lines
366 B
Rust
22 lines
366 B
Rust
use alloc::string::{String, ToString};
|
|
|
|
#[derive(Fail, Debug)]
|
|
#[fail(display = "Wasm trap")]
|
|
pub struct Trap {
|
|
message: String,
|
|
}
|
|
|
|
impl Trap {
|
|
pub fn new(message: String) -> Trap {
|
|
Trap { message }
|
|
}
|
|
|
|
pub fn fake() -> Trap {
|
|
Trap::new("TODO trap".to_string())
|
|
}
|
|
|
|
pub fn message(&self) -> &str {
|
|
&self.message
|
|
}
|
|
}
|