Rollup merge of #151309 - main, r=alexcrichton

fix: thread creation failed on the wasm32-wasip1-threads target.

wasm32-wasip1-threads target cannot create thread since nightly-2026-01-16.
This commit (c1bcae0638) broken it.
It in https://github.com/rust-lang/rust/pull/151016

This pull-request fix that issue.
This commit is contained in:
Jonathan Brouwer 2026-01-18 21:43:45 +01:00 committed by GitHub
commit 3222939950
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,7 @@ impl Thread {
// WASI does not support threading via pthreads. While wasi-libc provides
// pthread stubs, pthread_create returns EAGAIN, which causes confusing
// errors. We return UNSUPPORTED_PLATFORM directly instead.
if cfg!(target_os = "wasi") {
if cfg!(all(target_os = "wasi", not(target_feature = "atomics"))) {
return Err(io::Error::UNSUPPORTED_PLATFORM);
}