diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2021-10-28 16:28:21 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2021-11-10 08:35:42 -0800 |
| commit | 971638824fd859eb28dbee069ad109fc80e3e5c5 (patch) | |
| tree | a7378f4ad38642295f0179925b27a9d50262e1ae /library/std/src | |
| parent | cfb2f98e9e0bfbad2078b6632c1456c528824088 (diff) | |
| download | rust-971638824fd859eb28dbee069ad109fc80e3e5c5.tar.gz rust-971638824fd859eb28dbee069ad109fc80e3e5c5.zip | |
Use `target_family = "wasm"`
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sys/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys_common/mod.rs | 3 | ||||
| -rw-r--r-- | library/std/src/thread/local.rs | 20 | ||||
| -rw-r--r-- | library/std/src/thread/mod.rs | 5 |
4 files changed, 10 insertions, 20 deletions
diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 38f45fef918..167c918c94c 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -40,7 +40,7 @@ cfg_if::cfg_if! { } else if #[cfg(target_os = "wasi")] { mod wasi; pub use self::wasi::*; - } else if #[cfg(any(target_arch = "wasm32", target_arch = "wasm64"))] { + } else if #[cfg(target_family = "wasm")] { mod wasm; pub use self::wasm::*; } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] { diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs index 0f2a8cd0012..804727fbc54 100644 --- a/library/std/src/sys_common/mod.rs +++ b/library/std/src/sys_common/mod.rs @@ -40,8 +40,7 @@ cfg_if::cfg_if! { if #[cfg(any(target_os = "l4re", target_os = "hermit", feature = "restricted-std", - all(target_arch = "wasm32", not(target_os = "emscripten")), - all(target_arch = "wasm64", not(target_os = "emscripten")), + all(target_family = "wasm", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx")))] { pub use crate::sys::net; } else { diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 37f9cc40be6..da297c92017 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -172,7 +172,7 @@ macro_rules! __thread_local_inner { // // FIXME(#84224) this should come after the `target_thread_local` // block. - #[cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_feature = "atomics")))] + #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] { static mut VAL: $t = $init; Some(&VAL) @@ -181,10 +181,7 @@ macro_rules! __thread_local_inner { // If the platform has support for `#[thread_local]`, use it. #[cfg(all( target_thread_local, - not(all( - any(target_arch = "wasm32", target_arch = "wasm64"), - not(target_feature = "atomics"), - )), + not(all(target_family = "wasm", not(target_feature = "atomics"))), ))] { // If a dtor isn't needed we can do something "very raw" and @@ -241,10 +238,7 @@ macro_rules! __thread_local_inner { // same implementation as below for os thread locals. #[cfg(all( not(target_thread_local), - not(all( - any(target_arch = "wasm32", target_arch = "wasm64"), - not(target_feature = "atomics"), - )), + not(all(target_family = "wasm", not(target_feature = "atomics"))), ))] { #[inline] @@ -291,21 +285,21 @@ macro_rules! __thread_local_inner { // The issue of "should enable on Windows sometimes" is #84933 #[cfg_attr(not(windows), inline)] unsafe fn __getit() -> $crate::option::Option<&'static $t> { - #[cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_feature = "atomics")))] + #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] static __KEY: $crate::thread::__StaticLocalKeyInner<$t> = $crate::thread::__StaticLocalKeyInner::new(); #[thread_local] #[cfg(all( target_thread_local, - not(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_feature = "atomics"))), + not(all(target_family = "wasm", not(target_feature = "atomics"))), ))] static __KEY: $crate::thread::__FastLocalKeyInner<$t> = $crate::thread::__FastLocalKeyInner::new(); #[cfg(all( not(target_thread_local), - not(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_feature = "atomics"))), + not(all(target_family = "wasm", not(target_feature = "atomics"))), ))] static __KEY: $crate::thread::__OsLocalKeyInner<$t> = $crate::thread::__OsLocalKeyInner::new(); @@ -488,7 +482,7 @@ mod lazy { /// On some platforms like wasm there's no threads, so no need to generate /// thread locals and we can instead just use plain statics! #[doc(hidden)] -#[cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_feature = "atomics")))] +#[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] pub mod statik { use super::lazy::LazyKeyInner; use crate::fmt; diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 41f7bf55f22..39b53b51bfa 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -200,10 +200,7 @@ pub use self::local::fast::Key as __FastLocalKeyInner; #[doc(hidden)] pub use self::local::os::Key as __OsLocalKeyInner; #[unstable(feature = "libstd_thread_internals", issue = "none")] -#[cfg(all( - any(target_arch = "wasm32", target_arch = "wasm64"), - not(target_feature = "atomics") -))] +#[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] #[doc(hidden)] pub use self::local::statik::Key as __StaticLocalKeyInner; |
