wiggle: introduce wiggle::Trap, which can be either a String or I32

also, make noreturn functions always return a Trap

wasmtime-wiggle can trivially turn a wiggle::Trap into a wasmtime::Trap.
lucet will have to do the same.
This commit is contained in:
Pat Hickey
2021-01-05 18:19:31 -08:00
parent 4018a06da2
commit f8f9b14c6f
5 changed files with 70 additions and 46 deletions

View File

@@ -928,3 +928,9 @@ impl Pointee for str {
<[u8]>::debug(pointer, f)
}
}
#[derive(Debug, Clone)]
pub enum Trap {
I32(i32),
String(String),
}