Initial reorg.

This is largely the same as #305, but updated for the current tree.
This commit is contained in:
Dan Gohman
2019-11-07 17:11:06 -08:00
parent 2c69546a24
commit 22641de629
351 changed files with 52 additions and 52 deletions

22
crates/api/src/trap.rs Normal file
View File

@@ -0,0 +1,22 @@
use alloc::string::{String, ToString};
use thiserror::Error;
#[derive(Error, Debug)]
#[error("Wasm trap: {message}")]
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
}
}