From 29ebfa4d937d8833adfb11eaed4498014dcb0fc6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 28 Feb 2022 17:18:37 -0600 Subject: [PATCH] Fix a nightly warning (#3863) Looks like this `unsafe` block is not necessary, even on stable, and nightly linting has picked it up now. --- crates/wasmtime/src/func.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wasmtime/src/func.rs b/crates/wasmtime/src/func.rs index 47a50e2045..ac8272088a 100644 --- a/crates/wasmtime/src/func.rs +++ b/crates/wasmtime/src/func.rs @@ -2049,7 +2049,7 @@ impl HostFunc { ty: FuncType, func: impl Fn(Caller<'_, T>, *mut ValRaw) -> Result<(), Trap> + Send + Sync + 'static, ) -> Self { - let func = move |caller_vmctx, values: *mut ValRaw| unsafe { + let func = move |caller_vmctx, values: *mut ValRaw| { Caller::::with(caller_vmctx, |caller| func(caller, values)) }; let (instance, trampoline) = crate::trampoline::create_function(&ty, func, engine)