Use target family insted of target arch (#2975)

* Replace cfg target_arch wasm32 with target_family wasm

* Fix warnings in test builds from previous pr
This commit is contained in:
Timon
2025-08-03 10:28:53 +00:00
committed by GitHub
parent 1e3c3da3fe
commit 67123f55dc
18 changed files with 106 additions and 96 deletions
+10 -10
View File
@@ -363,31 +363,31 @@ fn simple_downcast_panic() {
assert_eq!(*downcast::<u32>(x).expect("attempted to perform invalid downcast"), 3_u32);
}
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
pub trait WasmNotSend: Send {}
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
pub trait WasmNotSend {}
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
impl<T: Send> WasmNotSend for T {}
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
impl<T> WasmNotSend for T {}
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
pub trait WasmNotSync: Sync {}
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
pub trait WasmNotSync {}
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
impl<T: Sync> WasmNotSync for T {}
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
impl<T> WasmNotSync for T {}
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
#[cfg(feature = "alloc")]
pub type DynFuture<'n, T> = Pin<Box<dyn core::future::Future<Output = T> + 'n + Send>>;
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
#[cfg(feature = "alloc")]
pub type DynFuture<'n, T> = Pin<Box<dyn core::future::Future<Output = T> + 'n>>;