Stream: rust-toolchain

Topic: detecting coop multithreading via cfg guards


view this post on Zulip Joel Dice (Nov 02 2026 at 15:16):

This recent Tokio issue shows that folks are eager to use both the wasm32-wasip3 target and cooperative multithreading despite neither being stable yet. What's the "right" way to detect the latter in a cfg guard?

view this post on Zulip Alex Crichton (Nov 02 2026 at 15:21):

No current #[cfg] at this time

view this post on Zulip Alex Crichton (Nov 02 2026 at 15:22):

But compiling with threads requires setting a bunch of flags, one of which could be a custom --cfg

view this post on Zulip Joel Dice (Nov 02 2026 at 15:23):

What guidance would you have on that issue, then? Wait for threading to stabilize before trying to use it?

view this post on Zulip Joel Dice (Nov 02 2026 at 15:26):

or maybe use something like RUSTFLAGS="--cfg tokio_unstable_wasip3_threading"?


Last updated: Nov 19 2026 at 20:05 UTC