Fix a nightly warning (#3863)

Looks like this `unsafe` block is not necessary, even on stable, and
nightly linting has picked it up now.
This commit is contained in:
Alex Crichton
2022-02-28 17:18:37 -06:00
committed by GitHub
parent cd173cfe8e
commit 29ebfa4d93

View File

@@ -2049,7 +2049,7 @@ impl HostFunc {
ty: FuncType, ty: FuncType,
func: impl Fn(Caller<'_, T>, *mut ValRaw) -> Result<(), Trap> + Send + Sync + 'static, func: impl Fn(Caller<'_, T>, *mut ValRaw) -> Result<(), Trap> + Send + Sync + 'static,
) -> Self { ) -> Self {
let func = move |caller_vmctx, values: *mut ValRaw| unsafe { let func = move |caller_vmctx, values: *mut ValRaw| {
Caller::<T>::with(caller_vmctx, |caller| func(caller, values)) Caller::<T>::with(caller_vmctx, |caller| func(caller, values))
}; };
let (instance, trampoline) = crate::trampoline::create_function(&ty, func, engine) let (instance, trampoline) = crate::trampoline::create_function(&ty, func, engine)