From 0dc62da21b0bffe113e2efa23f6da6ef4e36bf4f Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Tue, 26 Jul 2022 09:47:39 +0200 Subject: [PATCH] chore: use `target_family` wasm instead of `target_arch` wasm32 (#4864) --- tokio/Cargo.toml | 8 ++++---- tokio/src/coop.rs | 2 +- tokio/src/io/driver/registration.rs | 2 +- tokio/src/lib.rs | 2 +- tokio/src/macros/cfg.rs | 6 +++--- tokio/src/runtime/mod.rs | 2 +- tokio/src/runtime/task/mod.rs | 2 +- tokio/src/sync/tests/atomic_waker.rs | 4 ++-- tokio/src/sync/tests/notify.rs | 4 ++-- tokio/src/sync/tests/semaphore_batch.rs | 4 ++-- tokio/src/util/linked_list.rs | 4 ++-- tokio/tests/_require_full.rs | 2 +- tokio/tests/macros_join.rs | 6 +++--- tokio/tests/macros_pin.rs | 4 ++-- tokio/tests/macros_select.rs | 4 ++-- tokio/tests/macros_try_join.rs | 4 ++-- tokio/tests/sync_barrier.rs | 2 +- tokio/tests/sync_broadcast.rs | 8 ++++---- tokio/tests/sync_errors.rs | 2 +- tokio/tests/sync_mpsc.rs | 16 ++++++++-------- tokio/tests/sync_mutex.rs | 6 +++--- tokio/tests/sync_mutex_owned.rs | 6 +++--- tokio/tests/sync_notify.rs | 2 +- tokio/tests/sync_oneshot.rs | 8 ++++---- tokio/tests/sync_rwlock.rs | 6 +++--- tokio/tests/sync_semaphore.rs | 4 ++-- tokio/tests/sync_semaphore_owned.rs | 2 +- tokio/tests/sync_watch.rs | 4 ++-- 28 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index ff5b1360ad4..3ffa3fad05a 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -117,7 +117,7 @@ mio = { version = "0.8.4", optional = true } num_cpus = { version = "1.8.0", optional = true } parking_lot = { version = "0.12.0", optional = true } -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +[target.'cfg(not(target_family = "wasm"))'.dependencies] socket2 = { version = "0.4.4", features = [ "all" ] } # Currently unstable. The API exposed by these features may be broken at any time. @@ -150,14 +150,14 @@ mockall = "0.11.1" tempfile = "3.1.0" async-stream = "0.3" -[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] +[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] proptest = "1" socket2 = "0.4" -[target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dev-dependencies] +[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dev-dependencies] rand = "0.8.0" -[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dev-dependencies] +[target.'cfg(all(target_family = "wasm", not(target_os = "wasi")))'.dev-dependencies] wasm-bindgen-test = "0.3.0" [target.'cfg(target_os = "freebsd")'.dev-dependencies] diff --git a/tokio/src/coop.rs b/tokio/src/coop.rs index 1ed1d17aa9f..25a28cc27f3 100644 --- a/tokio/src/coop.rs +++ b/tokio/src/coop.rs @@ -207,7 +207,7 @@ cfg_coop! { mod test { use super::*; - #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] + #[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; fn get() -> Budget { diff --git a/tokio/src/io/driver/registration.rs b/tokio/src/io/driver/registration.rs index dbc34592e3a..281a48a0bcb 100644 --- a/tokio/src/io/driver/registration.rs +++ b/tokio/src/io/driver/registration.rs @@ -115,7 +115,7 @@ impl Registration { // Uses the poll path, requiring the caller to ensure mutual exclusion for // correctness. Only the last task to call this function is notified. - #[cfg(not(all(target_arch = "wasm32", target_os = "wasi")))] + #[cfg(not(all(target_family = "wasm", target_os = "wasi")))] pub(crate) fn poll_read_io( &self, cx: &mut Context<'_>, diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index e8ddf16b39e..2d2342e09a0 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -395,7 +395,7 @@ compile_error! { #[cfg(all( not(tokio_unstable), - target_arch = "wasm32", + target_family = "wasm", any( feature = "fs", feature = "io-std", diff --git a/tokio/src/macros/cfg.rs b/tokio/src/macros/cfg.rs index f728722132d..2e21420bfb3 100644 --- a/tokio/src/macros/cfg.rs +++ b/tokio/src/macros/cfg.rs @@ -459,7 +459,7 @@ macro_rules! cfg_has_atomic_u64 { target_arch = "mips", target_arch = "powerpc", target_arch = "riscv32", - target_arch = "wasm32" + target_family = "wasm" )))] $item )* @@ -474,7 +474,7 @@ macro_rules! cfg_not_has_atomic_u64 { target_arch = "mips", target_arch = "powerpc", target_arch = "riscv32", - target_arch = "wasm32" + target_family = "wasm" ))] $item )* @@ -493,7 +493,7 @@ macro_rules! cfg_not_wasi { macro_rules! cfg_is_wasm_not_wasi { ($($item:item)*) => { $( - #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] + #[cfg(all(target_family = "wasm", not(target_os = "wasi")))] $item )* } diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index c0e2d96db8a..2562093191c 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -174,7 +174,7 @@ // At the top due to macros #[cfg(test)] -#[cfg(not(target_arch = "wasm32"))] +#[cfg(not(target_family = "wasm"))] #[macro_use] mod tests; diff --git a/tokio/src/runtime/task/mod.rs b/tokio/src/runtime/task/mod.rs index 46aa62b14d1..e9b3393be98 100644 --- a/tokio/src/runtime/task/mod.rs +++ b/tokio/src/runtime/task/mod.rs @@ -389,7 +389,7 @@ impl LocalNotified { impl UnownedTask { // Used in test of the inject queue. #[cfg(test)] - #[cfg_attr(target_arch = "wasm32", allow(dead_code))] + #[cfg_attr(target_family = "wasm", allow(dead_code))] pub(super) fn into_notified(self) -> Notified { Notified(self.into_task()) } diff --git a/tokio/src/sync/tests/atomic_waker.rs b/tokio/src/sync/tests/atomic_waker.rs index 34bb9fbe782..735e3210c6a 100644 --- a/tokio/src/sync/tests/atomic_waker.rs +++ b/tokio/src/sync/tests/atomic_waker.rs @@ -12,7 +12,7 @@ impl AssertSync for AtomicWaker {} impl AssertSend for Waker {} impl AssertSync for Waker {} -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; #[test] @@ -37,7 +37,7 @@ fn wake_without_register() { } #[test] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn atomic_waker_panic_safe() { use std::panic; use std::ptr; diff --git a/tokio/src/sync/tests/notify.rs b/tokio/src/sync/tests/notify.rs index 858752b6fe5..d52fc3db913 100644 --- a/tokio/src/sync/tests/notify.rs +++ b/tokio/src/sync/tests/notify.rs @@ -4,7 +4,7 @@ use std::mem::ManuallyDrop; use std::sync::Arc; use std::task::{Context, RawWaker, RawWakerVTable, Waker}; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; #[test] @@ -63,7 +63,7 @@ fn notify_simple() { } #[test] -#[cfg(not(target_arch = "wasm32"))] +#[cfg(not(target_family = "wasm"))] fn watch_test() { let rt = crate::runtime::Builder::new_current_thread() .build() diff --git a/tokio/src/sync/tests/semaphore_batch.rs b/tokio/src/sync/tests/semaphore_batch.rs index 103e09dea4f..69a4d4bda6b 100644 --- a/tokio/src/sync/tests/semaphore_batch.rs +++ b/tokio/src/sync/tests/semaphore_batch.rs @@ -1,7 +1,7 @@ use crate::sync::batch_semaphore::Semaphore; use tokio_test::*; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; #[test] @@ -170,7 +170,7 @@ fn poll_acquire_one_zero_permits() { #[test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn validates_max_permits() { use std::usize; Semaphore::new((usize::MAX >> 2) + 1); diff --git a/tokio/src/util/linked_list.rs b/tokio/src/util/linked_list.rs index af963204467..372e93d0cc3 100644 --- a/tokio/src/util/linked_list.rs +++ b/tokio/src/util/linked_list.rs @@ -623,7 +623,7 @@ mod tests { } } - #[cfg(not(target_arch = "wasm32"))] + #[cfg(not(target_family = "wasm"))] proptest::proptest! { #[test] fn fuzz_linked_list(ops: Vec) { @@ -631,7 +631,7 @@ mod tests { } } - #[cfg(not(target_arch = "wasm32"))] + #[cfg(not(target_family = "wasm"))] fn run_fuzz(ops: Vec) { use std::collections::VecDeque; diff --git a/tokio/tests/_require_full.rs b/tokio/tests/_require_full.rs index 3abda2629cf..c7c5069b5d2 100644 --- a/tokio/tests/_require_full.rs +++ b/tokio/tests/_require_full.rs @@ -1,2 +1,2 @@ -#![cfg(not(any(feature = "full", target_arch = "wasm32")))] +#![cfg(not(any(feature = "full", target_family = "wasm")))] compile_error!("run main Tokio tests with `--features full`"); diff --git a/tokio/tests/macros_join.rs b/tokio/tests/macros_join.rs index b2969557f45..0c7989b50c9 100644 --- a/tokio/tests/macros_join.rs +++ b/tokio/tests/macros_join.rs @@ -2,12 +2,12 @@ #![allow(clippy::blacklisted_name)] use std::sync::Arc; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use tokio::sync::{oneshot, Semaphore}; diff --git a/tokio/tests/macros_pin.rs b/tokio/tests/macros_pin.rs index 001528ddeb0..2de68ad031f 100644 --- a/tokio/tests/macros_pin.rs +++ b/tokio/tests/macros_pin.rs @@ -1,9 +1,9 @@ #![cfg(feature = "macros")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; async fn one() {} diff --git a/tokio/tests/macros_select.rs b/tokio/tests/macros_select.rs index c7297b52884..16d49ebf9a6 100644 --- a/tokio/tests/macros_select.rs +++ b/tokio/tests/macros_select.rs @@ -1,10 +1,10 @@ #![cfg(feature = "macros")] #![allow(clippy::blacklisted_name)] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use tokio::sync::oneshot; diff --git a/tokio/tests/macros_try_join.rs b/tokio/tests/macros_try_join.rs index 876de0b496a..695b14de74c 100644 --- a/tokio/tests/macros_try_join.rs +++ b/tokio/tests/macros_try_join.rs @@ -6,10 +6,10 @@ use std::sync::Arc; use tokio::sync::{oneshot, Semaphore}; use tokio_test::{assert_pending, assert_ready, task}; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; #[maybe_tokio_test] diff --git a/tokio/tests/sync_barrier.rs b/tokio/tests/sync_barrier.rs index afd3ef16b5f..ac5977f24d8 100644 --- a/tokio/tests/sync_barrier.rs +++ b/tokio/tests/sync_barrier.rs @@ -2,7 +2,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; use tokio::sync::Barrier; diff --git a/tokio/tests/sync_broadcast.rs b/tokio/tests/sync_broadcast.rs index 7ca8281ce3e..2447b53ea88 100644 --- a/tokio/tests/sync_broadcast.rs +++ b/tokio/tests/sync_broadcast.rs @@ -2,7 +2,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; use tokio::sync::broadcast; @@ -276,14 +276,14 @@ fn send_no_rx() { #[test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn zero_capacity() { broadcast::channel::<()>(0); } #[test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn capacity_too_big() { use std::usize; @@ -291,7 +291,7 @@ fn capacity_too_big() { } #[test] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn panic_in_clone() { use std::panic::{self, AssertUnwindSafe}; diff --git a/tokio/tests/sync_errors.rs b/tokio/tests/sync_errors.rs index 3dd42fad2f6..4e43c8f311e 100644 --- a/tokio/tests/sync_errors.rs +++ b/tokio/tests/sync_errors.rs @@ -1,7 +1,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; fn is_error() {} diff --git a/tokio/tests/sync_mpsc.rs b/tokio/tests/sync_mpsc.rs index a1510f57d09..9d318b62aec 100644 --- a/tokio/tests/sync_mpsc.rs +++ b/tokio/tests/sync_mpsc.rs @@ -2,12 +2,12 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use tokio::sync::mpsc; @@ -16,7 +16,7 @@ use tokio_test::*; use std::sync::Arc; -#[cfg(not(target_arch = "wasm32"))] +#[cfg(not(target_family = "wasm"))] mod support { pub(crate) mod mpsc_stream; } @@ -155,7 +155,7 @@ async fn start_send_past_cap() { #[test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn buffer_gteq_one() { mpsc::channel::(0); } @@ -471,7 +471,7 @@ fn blocking_recv() { #[tokio::test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding async fn blocking_recv_async() { let (_tx, mut rx) = mpsc::channel::<()>(1); let _ = rx.blocking_recv(); @@ -496,7 +496,7 @@ fn blocking_send() { #[tokio::test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding async fn blocking_send_async() { let (tx, _rx) = mpsc::channel::<()>(1); let _ = tx.blocking_send(()); @@ -649,7 +649,7 @@ async fn recv_timeout() { #[test] #[should_panic = "there is no reactor running, must be called from the context of a Tokio 1.x runtime"] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn recv_timeout_panic() { use futures::future::FutureExt; use tokio::time::Duration; diff --git a/tokio/tests/sync_mutex.rs b/tokio/tests/sync_mutex.rs index ef60a348f93..381fe2d73a9 100644 --- a/tokio/tests/sync_mutex.rs +++ b/tokio/tests/sync_mutex.rs @@ -1,12 +1,12 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use tokio::sync::Mutex; diff --git a/tokio/tests/sync_mutex_owned.rs b/tokio/tests/sync_mutex_owned.rs index 5fb48ec8a0a..badcef3d08e 100644 --- a/tokio/tests/sync_mutex_owned.rs +++ b/tokio/tests/sync_mutex_owned.rs @@ -1,12 +1,12 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use tokio::sync::Mutex; diff --git a/tokio/tests/sync_notify.rs b/tokio/tests/sync_notify.rs index 4bbc71c5054..e31b9d49cff 100644 --- a/tokio/tests/sync_notify.rs +++ b/tokio/tests/sync_notify.rs @@ -1,7 +1,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; use tokio::sync::Notify; diff --git a/tokio/tests/sync_oneshot.rs b/tokio/tests/sync_oneshot.rs index 76194abae1f..163d50de9d2 100644 --- a/tokio/tests/sync_oneshot.rs +++ b/tokio/tests/sync_oneshot.rs @@ -1,12 +1,12 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use tokio::sync::oneshot; @@ -179,7 +179,7 @@ fn explicit_close_try_recv() { #[test] #[should_panic] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn close_try_recv_poll() { let (_tx, rx) = oneshot::channel::(); let mut rx = task::spawn(rx); diff --git a/tokio/tests/sync_rwlock.rs b/tokio/tests/sync_rwlock.rs index ff10fa324db..45d279aa3ec 100644 --- a/tokio/tests/sync_rwlock.rs +++ b/tokio/tests/sync_rwlock.rs @@ -1,12 +1,12 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; -#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))] +#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))] use tokio::test as maybe_tokio_test; use std::task::Poll; diff --git a/tokio/tests/sync_semaphore.rs b/tokio/tests/sync_semaphore.rs index fe5807c8e7e..481ec433740 100644 --- a/tokio/tests/sync_semaphore.rs +++ b/tokio/tests/sync_semaphore.rs @@ -1,6 +1,6 @@ #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; use std::sync::Arc; @@ -93,7 +93,7 @@ fn add_max_amount_permits() { assert_eq!(s.available_permits(), usize::MAX >> 3); } -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding #[test] #[should_panic] fn add_more_than_max_amount_permits() { diff --git a/tokio/tests/sync_semaphore_owned.rs b/tokio/tests/sync_semaphore_owned.rs index c01add3cacc..a1adb1aafb1 100644 --- a/tokio/tests/sync_semaphore_owned.rs +++ b/tokio/tests/sync_semaphore_owned.rs @@ -1,6 +1,6 @@ #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; use std::sync::Arc; diff --git a/tokio/tests/sync_watch.rs b/tokio/tests/sync_watch.rs index 13aecc25971..23c774dde4a 100644 --- a/tokio/tests/sync_watch.rs +++ b/tokio/tests/sync_watch.rs @@ -2,7 +2,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +#[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; use tokio::sync::watch; @@ -213,7 +213,7 @@ fn reopened_after_subscribe() { } #[test] -#[cfg(not(target_arch = "wasm32"))] // wasm currently doesn't support unwinding +#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding fn send_modify_panic() { let (tx, mut rx) = watch::channel("one");