diff --git a/compiler/rustc_codegen_cranelift/patches/0028-sysroot_tests-Disable-long-running-tests.patch b/compiler/rustc_codegen_cranelift/patches/0028-sysroot_tests-Disable-long-running-tests.patch index 853acab2773b5..e503acf8fee8c 100644 --- a/compiler/rustc_codegen_cranelift/patches/0028-sysroot_tests-Disable-long-running-tests.patch +++ b/compiler/rustc_codegen_cranelift/patches/0028-sysroot_tests-Disable-long-running-tests.patch @@ -14,7 +14,7 @@ index 8402833..84592e0 100644 @@ -1619,7 +1619,7 @@ fn brute_force_rotate_test_1() { #[test] - #[cfg(not(target_arch = "wasm32"))] + #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] -#[cfg_attr(miri, ignore)] // Miri is too slow +#[ignore] // Miri is too slow fn select_nth_unstable() { diff --git a/library/core/src/os/mod.rs b/library/core/src/os/mod.rs index 5ac2b637941ae..8d177dd3947c9 100644 --- a/library/core/src/os/mod.rs +++ b/library/core/src/os/mod.rs @@ -6,7 +6,7 @@ #[cfg(all( doc, any( - all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_family = "wasm", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") ) ))] @@ -17,7 +17,7 @@ pub mod darwin {} #[cfg(not(all( doc, any( - all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_family = "wasm", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") ) )))] diff --git a/library/coretests/benches/lib.rs b/library/coretests/benches/lib.rs index e8dc815a7dd0f..4815c3e44e1a1 100644 --- a/library/coretests/benches/lib.rs +++ b/library/coretests/benches/lib.rs @@ -1,5 +1,5 @@ -// wasm32 does not support benches (no time). -#![cfg(not(target_arch = "wasm32"))] +// wasm*-unknown-unknown does not support benches (no time). +#![cfg(all(target_family = "wasm", target_os = "unknown"))] // This is marked as `test = true` and hence picked up by `./x miri`, but that would be too slow. #![cfg(not(miri))] #![feature(flt2dec)] diff --git a/library/coretests/tests/num/flt2dec/random.rs b/library/coretests/tests/num/flt2dec/random.rs index e47aa6d37a804..b90386aee617c 100644 --- a/library/coretests/tests/num/flt2dec/random.rs +++ b/library/coretests/tests/num/flt2dec/random.rs @@ -1,4 +1,4 @@ -#![cfg(not(target_arch = "wasm32"))] +#![cfg(not(all(target_family = "wasm", target_os = "unknown")))] use core::num::imp::flt2dec; use std::mem::MaybeUninit; diff --git a/library/coretests/tests/slice.rs b/library/coretests/tests/slice.rs index e570bff645af7..f7149abaf3f16 100644 --- a/library/coretests/tests/slice.rs +++ b/library/coretests/tests/slice.rs @@ -1679,7 +1679,7 @@ fn brute_force_rotate_test_1() { } #[test] -#[cfg(not(target_arch = "wasm32"))] +#[cfg(not(all(target_family = "wasm", target_os = "unknown")))] #[cfg_attr(miri, ignore)] // Miri is too slow fn select_nth_unstable() { use core::cmp::Ordering::{Equal, Greater, Less}; diff --git a/library/std/benches/time.rs b/library/std/benches/time.rs index dfd886738f984..48d83672362b7 100644 --- a/library/std/benches/time.rs +++ b/library/std/benches/time.rs @@ -1,10 +1,10 @@ -#[cfg(not(target_arch = "wasm32"))] +#[cfg(not(all(target_family = "wasm", target_os = "unknown")))] use test::{Bencher, black_box}; macro_rules! bench_instant_threaded { ($bench_name:ident, $thread_count:expr) => { #[bench] - #[cfg(not(target_arch = "wasm32"))] + #[cfg(not(all(target_family = "wasm", target_os = "unknown")))] fn $bench_name(b: &mut Bencher) -> std::thread::Result<()> { use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs index 00f802e5d9155..e5c2522a837fb 100644 --- a/library/std/src/net/tcp.rs +++ b/library/std/src/net/tcp.rs @@ -913,9 +913,9 @@ impl TcpListener { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> { - // On WASM, `TcpStream` is uninhabited (as it's unsupported) and so - // the `a` variable here is technically unused. - #[cfg_attr(target_arch = "wasm32", allow(unused_variables))] + // On wasm*-unknown-unknown, `TcpStream` is uninhabited (as it's + // unsupported) and so the `a` variable here is technically unused. + #[cfg_attr(all(target_family = "wasm", target_os = "unknown"), allow(unused_variables))] self.0.accept().map(|(a, b)| (TcpStream(a), b)) } diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs index 87a8e20bad0d3..6c6f9b552c926 100644 --- a/library/std/src/os/fd/owned.rs +++ b/library/std/src/os/fd/owned.rs @@ -13,7 +13,7 @@ use crate::fs; use crate::marker::PhantomData; use crate::mem::ManuallyDrop; #[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "emscripten")), + all(target_family = "wasm", not(target_os = "emscripten")), target_env = "sgx", target_os = "hermit", target_os = "trusty", @@ -105,7 +105,7 @@ impl BorrowedFd<'_> { /// Creates a new `OwnedFd` instance that shares the same underlying file /// description as the existing `BorrowedFd` instance. #[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "emscripten")), + all(target_family = "wasm", not(target_os = "emscripten")), target_os = "hermit", target_os = "trusty", target_os = "motor" @@ -133,7 +133,7 @@ impl BorrowedFd<'_> { /// Creates a new `OwnedFd` instance that shares the same underlying file /// description as the existing `BorrowedFd` instance. #[cfg(any( - all(target_arch = "wasm32", not(target_os = "emscripten")), + all(target_family = "wasm", not(target_os = "emscripten")), target_os = "hermit", target_os = "trusty" ))] diff --git a/library/std/src/os/fd/raw.rs b/library/std/src/os/fd/raw.rs index a8d981520efd2..4d7b6a3e5fb53 100644 --- a/library/std/src/os/fd/raw.rs +++ b/library/std/src/os/fd/raw.rs @@ -17,7 +17,7 @@ use crate::io; use crate::os::hermit::io::OwnedFd; #[cfg(all(not(target_os = "hermit"), not(target_os = "motor")))] use crate::os::raw; -#[cfg(all(doc, not(any(target_arch = "wasm32", target_env = "sgx", target_os = "l4re"))))] +#[cfg(all(doc, not(any(target_family = "wasm", target_env = "sgx", target_os = "l4re"))))] use crate::os::unix::io::AsFd; #[cfg(unix)] use crate::os::unix::io::OwnedFd; diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index 8068f92bcc93c..f95c6ac8dd76d 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -16,7 +16,7 @@ pub mod raw; #[cfg(doc)] cfg_select! { any( - all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_family = "wasm", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") ) => { #[unstable(issue = "none", feature = "std_internals")] diff --git a/library/std/src/os/net/mod.rs b/library/std/src/os/net/mod.rs index 47e69b3a260dc..cbde585c8d79f 100644 --- a/library/std/src/os/net/mod.rs +++ b/library/std/src/os/net/mod.rs @@ -5,7 +5,7 @@ #[cfg(not(all( doc, any( - all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_family = "wasm", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") ) )))] diff --git a/library/std/src/os/unix/io/mod.rs b/library/std/src/os/unix/io/mod.rs index 4afb8ffa71017..099bdd35439a1 100644 --- a/library/std/src/os/unix/io/mod.rs +++ b/library/std/src/os/unix/io/mod.rs @@ -216,7 +216,7 @@ fn replace_stdio_fd(this: BorrowedFd<'_>, other: OwnedFd) -> io::Result<()> { .map(|_| ()) } not(any( - all(target_arch = "wasm32", not(target_os = "emscripten")), + all(target_family = "wasm", not(target_os = "emscripten")), target_os = "hermit", target_os = "trusty", target_os = "motor" diff --git a/library/std/tests/time.rs b/library/std/tests/time.rs index 6d8b4cbfd094f..4d47b068ab87a 100644 --- a/library/std/tests/time.rs +++ b/library/std/tests/time.rs @@ -29,7 +29,7 @@ fn instant_monotonic() { } #[test] -#[cfg(not(target_arch = "wasm32"))] +#[cfg(not(all(target_family = "wasm", target_os = "unknown")))] fn instant_monotonic_concurrent() -> std::thread::Result<()> { let threads: Vec<_> = (0..8) .map(|_| {