Skip to content

Commit f3bedc6

Browse files
committed
Replace target_arch with target_family
1 parent 1836107 commit f3bedc6

27 files changed

+62
-62
lines changed

tokio/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ mio = { version = "0.8.4", optional = true }
117117
num_cpus = { version = "1.8.0", optional = true }
118118
parking_lot = { version = "0.12.0", optional = true }
119119

120-
[target.'cfg(not(target_arch = "wasm"))'.dependencies]
120+
[target.'cfg(not(target_family = "wasm"))'.dependencies]
121121
socket2 = { version = "0.4.4", features = [ "all" ] }
122122

123123
# Currently unstable. The API exposed by these features may be broken at any time.
@@ -150,14 +150,14 @@ mockall = "0.11.1"
150150
tempfile = "3.1.0"
151151
async-stream = "0.3"
152152

153-
[target.'cfg(not(target_arch = "wasm"))'.dev-dependencies]
153+
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
154154
proptest = "1"
155155
socket2 = "0.4"
156156

157-
[target.'cfg(not(all(target_arch = "wasm", target_os = "unknown")))'.dev-dependencies]
157+
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dev-dependencies]
158158
rand = "0.8.0"
159159

160-
[target.'cfg(all(target_arch = "wasm", not(target_os = "wasi")))'.dev-dependencies]
160+
[target.'cfg(all(target_family = "wasm", not(target_os = "wasi")))'.dev-dependencies]
161161
wasm-bindgen-test = "0.3.0"
162162

163163
[target.'cfg(target_os = "freebsd")'.dev-dependencies]

tokio/src/coop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ cfg_coop! {
207207
mod test {
208208
use super::*;
209209

210-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
210+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
211211
use wasm_bindgen_test::wasm_bindgen_test as test;
212212

213213
fn get() -> Budget {

tokio/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ compile_error! {
395395

396396
#[cfg(all(
397397
not(tokio_unstable),
398-
target_arch = "wasm",
398+
target_family = "wasm",
399399
any(
400400
feature = "fs",
401401
feature = "io-std",

tokio/src/macros/cfg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ macro_rules! cfg_has_atomic_u64 {
459459
target_arch = "mips",
460460
target_arch = "powerpc",
461461
target_arch = "riscv32",
462-
target_arch = "wasm"
462+
target_family = "wasm"
463463
)))]
464464
$item
465465
)*
@@ -474,7 +474,7 @@ macro_rules! cfg_not_has_atomic_u64 {
474474
target_arch = "mips",
475475
target_arch = "powerpc",
476476
target_arch = "riscv32",
477-
target_arch = "wasm"
477+
target_family = "wasm"
478478
))]
479479
$item
480480
)*
@@ -493,7 +493,7 @@ macro_rules! cfg_not_wasi {
493493
macro_rules! cfg_is_wasm_not_wasi {
494494
($($item:item)*) => {
495495
$(
496-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
496+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
497497
$item
498498
)*
499499
}

tokio/src/runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
175175
// At the top due to macros
176176
#[cfg(test)]
177-
#[cfg(not(target_arch = "wasm"))]
177+
#[cfg(not(target_family = "wasm"))]
178178
#[macro_use]
179179
mod tests;
180180

tokio/src/runtime/task/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl<S: Schedule> LocalNotified<S> {
389389
impl<S: Schedule> UnownedTask<S> {
390390
// Used in test of the inject queue.
391391
#[cfg(test)]
392-
#[cfg_attr(target_arch = "wasm", allow(dead_code))]
392+
#[cfg_attr(target_family = "wasm", allow(dead_code))]
393393
pub(super) fn into_notified(self) -> Notified<S> {
394394
Notified(self.into_task())
395395
}

tokio/src/sync/tests/atomic_waker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl AssertSync for AtomicWaker {}
1212
impl AssertSend for Waker {}
1313
impl AssertSync for Waker {}
1414

15-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
15+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
1616
use wasm_bindgen_test::wasm_bindgen_test as test;
1717

1818
#[test]
@@ -37,7 +37,7 @@ fn wake_without_register() {
3737
}
3838

3939
#[test]
40-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
40+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
4141
fn atomic_waker_panic_safe() {
4242
use std::panic;
4343
use std::ptr;

tokio/src/sync/tests/notify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::mem::ManuallyDrop;
44
use std::sync::Arc;
55
use std::task::{Context, RawWaker, RawWakerVTable, Waker};
66

7-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
7+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
88
use wasm_bindgen_test::wasm_bindgen_test as test;
99

1010
#[test]
@@ -63,7 +63,7 @@ fn notify_simple() {
6363
}
6464

6565
#[test]
66-
#[cfg(not(target_arch = "wasm"))]
66+
#[cfg(not(target_family = "wasm"))]
6767
fn watch_test() {
6868
let rt = crate::runtime::Builder::new_current_thread()
6969
.build()

tokio/src/sync/tests/semaphore_batch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::sync::batch_semaphore::Semaphore;
22
use tokio_test::*;
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as test;
66

77
#[test]
@@ -170,7 +170,7 @@ fn poll_acquire_one_zero_permits() {
170170

171171
#[test]
172172
#[should_panic]
173-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
173+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
174174
fn validates_max_permits() {
175175
use std::usize;
176176
Semaphore::new((usize::MAX >> 2) + 1);

tokio/src/util/linked_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,15 @@ mod tests {
623623
}
624624
}
625625

626-
#[cfg(not(target_arch = "wasm"))]
626+
#[cfg(not(target_family = "wasm"))]
627627
proptest::proptest! {
628628
#[test]
629629
fn fuzz_linked_list(ops: Vec<usize>) {
630630
run_fuzz(ops);
631631
}
632632
}
633633

634-
#[cfg(not(target_arch = "wasm"))]
634+
#[cfg(not(target_family = "wasm"))]
635635
fn run_fuzz(ops: Vec<usize>) {
636636
use std::collections::VecDeque;
637637

tokio/tests/_require_full.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#![cfg(not(any(feature = "full", target_arch = "wasm")))]
1+
#![cfg(not(any(feature = "full", target_family = "wasm")))]
22
compile_error!("run main Tokio tests with `--features full`");

tokio/tests/macros_join.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#![allow(clippy::blacklisted_name)]
33
use std::sync::Arc;
44

5-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
5+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
66
use wasm_bindgen_test::wasm_bindgen_test as test;
7-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
7+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
88
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
99

10-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
10+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
1111
use tokio::test as maybe_tokio_test;
1212

1313
use tokio::sync::{oneshot, Semaphore};

tokio/tests/macros_pin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![cfg(feature = "macros")]
22

3-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
3+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
44
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
55

6-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
6+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
77
use tokio::test as maybe_tokio_test;
88

99
async fn one() {}

tokio/tests/macros_select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![cfg(feature = "macros")]
22
#![allow(clippy::blacklisted_name)]
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
66

7-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
7+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
88
use tokio::test as maybe_tokio_test;
99

1010
use tokio::sync::oneshot;

tokio/tests/macros_try_join.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::sync::Arc;
66
use tokio::sync::{oneshot, Semaphore};
77
use tokio_test::{assert_pending, assert_ready, task};
88

9-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
9+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
1010
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
1111

12-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
12+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
1313
use tokio::test as maybe_tokio_test;
1414

1515
#[maybe_tokio_test]

tokio/tests/sync_barrier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![warn(rust_2018_idioms)]
33
#![cfg(feature = "sync")]
44

5-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
5+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
66
use wasm_bindgen_test::wasm_bindgen_test as test;
77

88
use tokio::sync::Barrier;

tokio/tests/sync_broadcast.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![warn(rust_2018_idioms)]
33
#![cfg(feature = "sync")]
44

5-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
5+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
66
use wasm_bindgen_test::wasm_bindgen_test as test;
77

88
use tokio::sync::broadcast;
@@ -276,22 +276,22 @@ fn send_no_rx() {
276276

277277
#[test]
278278
#[should_panic]
279-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
279+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
280280
fn zero_capacity() {
281281
broadcast::channel::<()>(0);
282282
}
283283

284284
#[test]
285285
#[should_panic]
286-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
286+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
287287
fn capacity_too_big() {
288288
use std::usize;
289289

290290
broadcast::channel::<()>(1 + (usize::MAX >> 1));
291291
}
292292

293293
#[test]
294-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
294+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
295295
fn panic_in_clone() {
296296
use std::panic::{self, AssertUnwindSafe};
297297

tokio/tests/sync_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(rust_2018_idioms)]
22
#![cfg(feature = "sync")]
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as test;
66

77
fn is_error<T: std::error::Error + Send + Sync>() {}

tokio/tests/sync_mpsc.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#![warn(rust_2018_idioms)]
33
#![cfg(feature = "sync")]
44

5-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
5+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
66
use wasm_bindgen_test::wasm_bindgen_test as test;
7-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
7+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
88
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
99

10-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
10+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
1111
use tokio::test as maybe_tokio_test;
1212

1313
use tokio::sync::mpsc;
@@ -16,7 +16,7 @@ use tokio_test::*;
1616

1717
use std::sync::Arc;
1818

19-
#[cfg(not(target_arch = "wasm"))]
19+
#[cfg(not(target_family = "wasm"))]
2020
mod support {
2121
pub(crate) mod mpsc_stream;
2222
}
@@ -155,7 +155,7 @@ async fn start_send_past_cap() {
155155

156156
#[test]
157157
#[should_panic]
158-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
158+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
159159
fn buffer_gteq_one() {
160160
mpsc::channel::<i32>(0);
161161
}
@@ -471,7 +471,7 @@ fn blocking_recv() {
471471

472472
#[tokio::test]
473473
#[should_panic]
474-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
474+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
475475
async fn blocking_recv_async() {
476476
let (_tx, mut rx) = mpsc::channel::<()>(1);
477477
let _ = rx.blocking_recv();
@@ -496,7 +496,7 @@ fn blocking_send() {
496496

497497
#[tokio::test]
498498
#[should_panic]
499-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
499+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
500500
async fn blocking_send_async() {
501501
let (tx, _rx) = mpsc::channel::<()>(1);
502502
let _ = tx.blocking_send(());
@@ -649,7 +649,7 @@ async fn recv_timeout() {
649649

650650
#[test]
651651
#[should_panic = "there is no reactor running, must be called from the context of a Tokio 1.x runtime"]
652-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
652+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
653653
fn recv_timeout_panic() {
654654
use futures::future::FutureExt;
655655
use tokio::time::Duration;

tokio/tests/sync_mutex.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![warn(rust_2018_idioms)]
22
#![cfg(feature = "sync")]
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as test;
6-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
6+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
77
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
88

9-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
9+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
1010
use tokio::test as maybe_tokio_test;
1111

1212
use tokio::sync::Mutex;

tokio/tests/sync_mutex_owned.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![warn(rust_2018_idioms)]
22
#![cfg(feature = "sync")]
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as test;
6-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
6+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
77
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
88

9-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
9+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
1010
use tokio::test as maybe_tokio_test;
1111

1212
use tokio::sync::Mutex;

tokio/tests/sync_notify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(rust_2018_idioms)]
22
#![cfg(feature = "sync")]
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as test;
66

77
use tokio::sync::Notify;

tokio/tests/sync_oneshot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![warn(rust_2018_idioms)]
22
#![cfg(feature = "sync")]
33

4-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
4+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
55
use wasm_bindgen_test::wasm_bindgen_test as test;
6-
#[cfg(all(target_arch = "wasm", not(target_os = "wasi")))]
6+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
77
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
88

9-
#[cfg(not(all(target_arch = "wasm", not(target_os = "wasi"))))]
9+
#[cfg(not(all(target_family = "wasm", not(target_os = "wasi"))))]
1010
use tokio::test as maybe_tokio_test;
1111

1212
use tokio::sync::oneshot;
@@ -179,7 +179,7 @@ fn explicit_close_try_recv() {
179179

180180
#[test]
181181
#[should_panic]
182-
#[cfg(not(target_arch = "wasm"))] // wasm currently doesn't support unwinding
182+
#[cfg(not(target_family = "wasm"))] // wasm currently doesn't support unwinding
183183
fn close_try_recv_poll() {
184184
let (_tx, rx) = oneshot::channel::<i32>();
185185
let mut rx = task::spawn(rx);

0 commit comments

Comments
 (0)