(message: *const u8, len: usize)
| 112 | |
| 113 | #[unsafe(no_mangle)] |
| 114 | pub unsafe extern "C" fn wasmtime_trap_new(message: *const u8, len: usize) -> Box<wasm_trap_t> { |
| 115 | let bytes = crate::slice_from_raw_parts(message, len); |
| 116 | let message = String::from_utf8_lossy(&bytes); |
| 117 | Box::new(wasm_trap_t { |
| 118 | error: Error::msg(message.into_owned()), |
| 119 | }) |
| 120 | } |
| 121 | |
| 122 | #[unsafe(no_mangle)] |
| 123 | pub unsafe extern "C" fn wasmtime_trap_new_code(code: u8) -> Box<wasm_trap_t> { |
no test coverage detected