diff --git a/futures-core/Cargo.toml b/futures-core/Cargo.toml index 6fd0fea06f..8aec7246c7 100644 --- a/futures-core/Cargo.toml +++ b/futures-core/Cargo.toml @@ -16,7 +16,7 @@ std = ["alloc"] alloc = [] [dependencies] -portable-atomic = { version = "1", default-features = false, optional = true } +portable-atomic = { version = "1.3", optional = true, default-features = false, features = ["require-cas"] } [dev-dependencies] futures = { path = "../futures" } diff --git a/futures-core/src/task/__internal/mod.rs b/futures-core/src/task/__internal/mod.rs index c902eb4bfb..377f3e286c 100644 --- a/futures-core/src/task/__internal/mod.rs +++ b/futures-core/src/task/__internal/mod.rs @@ -1,4 +1,4 @@ -#[cfg(not(futures_no_atomic_cas))] +#[cfg(any(not(futures_no_atomic_cas), feature = "portable-atomic"))] mod atomic_waker; -#[cfg(not(futures_no_atomic_cas))] +#[cfg(any(not(futures_no_atomic_cas), feature = "portable-atomic"))] pub use self::atomic_waker::AtomicWaker; diff --git a/futures-util/src/task/mod.rs b/futures-util/src/task/mod.rs index 0a31eeac14..3ed4bfadad 100644 --- a/futures-util/src/task/mod.rs +++ b/futures-util/src/task/mod.rs @@ -30,7 +30,7 @@ pub use futures_task::waker; #[cfg(feature = "alloc")] pub use futures_task::{waker_ref, WakerRef}; -#[cfg(not(futures_no_atomic_cas))] +#[cfg(any(not(futures_no_atomic_cas), feature = "portable-atomic"))] pub use futures_core::task::__internal::AtomicWaker; mod spawn;