Stream: git-wasmtime

Topic: wasmtime / PR #11839 Remove usage of `async_trait` in `wi...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 11 2025 at 19:22):

dmartin opened PR #11839 from dmartin:remove-wiggle-async-trait to bytecodealliance:main:

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please 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<...> + Send return types for methods marked as async. This change is backwards-compatible with the use of async fn syntax 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-common crate 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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 11 2025 at 19:22):

dmartin requested wasmtime-wasi-reviewers for a review on PR #11839.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 11 2025 at 19:22):

dmartin requested pchickey for a review on PR #11839.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 11 2025 at 19:22):

dmartin requested wasmtime-core-reviewers for a review on PR #11839.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 11 2025 at 19:22):

dmartin requested wasmtime-default-reviewers for a review on PR #11839.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 11 2025 at 19:25):

dmartin edited PR #11839:

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please 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<...> + Send return types for methods marked as async. This change is backwards-compatible with the use of async fn syntax 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-common crate 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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2025 at 16:35):

pchickey submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2025 at 17:02):

pchickey merged PR #11839.


Last updated: Dec 06 2025 at 07:03 UTC