dmartin opened PR #11839 from dmartin:remove-wiggle-async-trait to bytecodealliance:main:
<!--
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
-->
Removes the need for#[wiggle::async_trait]by directly outputting-> impl Future<...> + Sendreturn types for methods marked as async. This change is backwards-compatible with the use ofasync fnsyntax in implementations.Looking through the commit history, it seems like
#[wiggle::async_trait]was originally introduced as convenient shorthand for#[async_trait::async_trait(?Send)], but was changed in https://github.com/bytecodealliance/wasmtime/pull/2897 to enforce Send bounds, making it a direct re-export.As part of this PR, I've removed the re-export and replaced non-binding-related uses in the
wasi-commoncrate with standard#[async_trait::async_trait]attributes.Anecdotally, in a large project with many uses of the
from_witx!macro, this change speeds up compilation time by 40% by simplifying type checking.
dmartin requested wasmtime-wasi-reviewers for a review on PR #11839.
dmartin requested pchickey for a review on PR #11839.
dmartin requested wasmtime-core-reviewers for a review on PR #11839.
dmartin requested wasmtime-default-reviewers for a review on PR #11839.
dmartin edited PR #11839:
<!--
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
-->
Removes the need for#[wiggle::async_trait]by directly outputting-> impl Future<...> + Sendreturn types for methods marked as async. This change is backwards-compatible with the use ofasync fnsyntax in implementations.Looking through the commit history, it seems like
#[wiggle::async_trait]was originally introduced as convenient shorthand for#[async_trait::async_trait(?Send)], but was changed in https://github.com/bytecodealliance/wasmtime/pull/2897 to enforce Send bounds, making it a direct re-export.As part of this PR, I've removed the re-export and replaced non-binding-related uses in the
wasi-commoncrate with standard#[async_trait::async_trait]attributes.Anecdotally, in a large project with many traits generated via the
from_witx!macro, this change speeds up compilation time by 40% by simplifying type checking.
pchickey submitted PR review:
Thanks!
pchickey merged PR #11839.
Last updated: Dec 06 2025 at 07:03 UTC