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:
Alex Crichton
2020-01-08 14:41:47 -06:00
committed by GitHub
parent 06be4b1495
commit c975a92a3a
9 changed files with 86 additions and 130 deletions

View File

@@ -45,7 +45,7 @@ pub fn instantiate_in_context(
)
.map_err(|e| -> Error {
if let Some(trap) = take_api_trap() {
Trap::from(trap).into()
trap.into()
} else if let SetupError::Instantiate(InstantiationError::StartTrap(msg)) = e {
Trap::new(msg).into()
} else {