Skip to content

Commit b08dcba

Browse files
committed
Remove a no-longer-necessary unsafe block
1 parent 491edf6 commit b08dcba

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

crates/wasmtime/src/runtime/store.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,7 @@ impl<T> Store<T> {
599599
data: ManuallyDrop::new(data),
600600
});
601601

602-
// Note the erasure of the lifetime here into `'static`, so in general
603-
// usage of this trait object must be strictly bounded to the `Store`
604-
// itself, and this is an invariant that we have to maintain throughout
605-
// Wasmtime.
606-
inner.traitobj = StorePtr::new(unsafe {
607-
mem::transmute::<
608-
NonNull<dyn crate::runtime::vm::VMStore + '_>,
609-
NonNull<dyn crate::runtime::vm::VMStore + 'static>,
610-
>(NonNull::from(&mut *inner))
611-
});
602+
inner.traitobj = StorePtr::new(NonNull::from(&mut *inner));
612603

613604
// Wasmtime uses the callee argument to host functions to learn about
614605
// the original pointer to the `Store` itself, allowing it to

0 commit comments

Comments
 (0)