Remove unsafety from Trap API (#779)
* Remove unsafety from `Trap` API This commit removes the `unsafe impl Send` for `Trap` by removing the internal `HostRef` and leaving `HostRef` entirely as an implementation detail of the C API. cc #708 * Run rustfmt
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::r#ref::HostRef;
|
||||
use crate::runtime::Store;
|
||||
use crate::trampoline::{generate_func_export, take_api_trap};
|
||||
use crate::trap::{Trap, TrapInfo};
|
||||
use crate::trap::Trap;
|
||||
use crate::types::FuncType;
|
||||
use crate::values::Val;
|
||||
use std::rc::Rc;
|
||||
@@ -158,9 +157,9 @@ impl WrappedCallable for WasmtimeFn {
|
||||
values_vec.as_mut_ptr() as *mut u8,
|
||||
)
|
||||
} {
|
||||
let trap = take_api_trap()
|
||||
.unwrap_or_else(|| HostRef::new(TrapInfo::new(format!("call error: {}", message))));
|
||||
return Err(trap.into());
|
||||
let trap =
|
||||
take_api_trap().unwrap_or_else(|| Trap::new(format!("call error: {}", message)));
|
||||
return Err(trap);
|
||||
}
|
||||
|
||||
// Load the return values out of `values_vec`.
|
||||
|
||||
Reference in New Issue
Block a user