SilverMira opened PR #14376 from SilverMira:main to bytecodealliance:main:
closes: issue #14366
Through some trait and lifetime magic, it is possible to effectively specify a
Sendbound on the unnamedFuturereturned byAsyncFnOnceon stable.This commit uses said magic and changes
AccessorTaskfrom a manually implemented trait into an async closure returning aFuturethat isSend. Users can now passasync move |accessor| { ... }intoAccessor::spawnand friends directly, skipping boilerplate of creating a struct and implementingAccessorTaskmanually.Additionally, it is no longer intended for users to manually implement
AccessorTask, as implementing the trait now requires Self to also implementAsyncFnOnce, which is unstable.All occurrences that manually implement
AccessorTaskwithin the repo is updated to just use an async closure.I have verified that rustc is happy with
cargo check -p wasmtime-wasi-tlsas recommended in #14366, in both the nightly trait solver and stable trait solver viaRUSTFLAGS=-Znext-solver=coherence.This is a breaking change of course.
SilverMira requested pchickey for a review on PR #14376.
SilverMira requested wasmtime-wasi-reviewers for a review on PR #14376.
SilverMira requested wasmtime-core-reviewers for a review on PR #14376.
SilverMira commented on PR #14376:
Changing to draft first..., seems like the 'a may not be required for this to work, 'fut seems to work fine
SilverMira converted PR #14376 Effectively replace AccessorTask with AsyncFnOnce in Accessor::spawn to a draft.
SilverMira updated PR #14376.
SilverMira has marked PR #14376 as ready for review.
github-actions[bot] added the label wasmtime:api on PR #14376.
:thumbs_up: fitzgen submitted PR review:
THanks!
fitzgen added PR #14376 Effectively replace AccessorTask with AsyncFnOnce in Accessor::spawn to the merge queue.
github-merge-queue[bot] removed PR #14376 Effectively replace AccessorTask with AsyncFnOnce in Accessor::spawn from the merge queue.
alexcrichton added PR #14376 Effectively replace AccessorTask with AsyncFnOnce in Accessor::spawn to the merge queue.
:check: alexcrichton merged PR #14376.
alexcrichton removed PR #14376 Effectively replace AccessorTask with AsyncFnOnce in Accessor::spawn from the merge queue.
Last updated: Oct 11 2026 at 02:20 UTC