alexcrichton opened PR #11444 from alexcrichton:remove-traitobj-mut to bytecodealliance:main:
This was a fundamentally unsound function because it is widening a mutable borrow to encompass more than it originally contained. Removal of its usage falls into a few buckets here:
Many instances of
store.0.traitobj_mut()were starting from a&mut StoreInner<T>, going to&mut StoreOpaque, then going back to&mut dyn VMStore. These are replaced withstore.0as&mut StoreInner<T>directly coerces into&mut dyn VMStore.Some fiber-related helpers were updated to take any store-opaque-thing which encapsulates the ability to start/resume a borrow with a part of the store, but you only get that part of the store during the fiber itself. This means there's no widening necessary.
Some methods previously taking
&mut StoreOpaqueare now appropriately widened to&mut dyn VMStore.This all enables full deletion of this function which prevents accidentally ever tripping over its unsound-ness.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #11444.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11444.
alexcrichton updated PR #11444.
alexcrichton updated PR #11444.
alexcrichton updated PR #11444.
fitzgen submitted PR review.
fitzgen created PR review comment:
Should this trait and its implementations move to
store.rs?
alexcrichton updated PR #11444.
alexcrichton has enabled auto merge for PR #11444.
alexcrichton updated PR #11444.
alexcrichton updated PR #11444.
alexcrichton updated PR #11444.
alexcrichton has enabled auto merge for PR #11444.
alexcrichton merged PR #11444.
Last updated: Dec 06 2025 at 06:05 UTC