Skip to content

Commit 4aeca50

Browse files
Nemo157cramertj
authored andcommitted
Separate cfg-target-has-atomic feature
1 parent 6199c65 commit 4aeca50

File tree

8 files changed

+14
-7
lines changed

8 files changed

+14
-7
lines changed

futures-core/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ name = "futures_core"
1818
default = ["std"]
1919
std = ["either/use_std"]
2020
nightly = []
21+
cfg-target-has-atomic = []
2122

2223
[dependencies]
2324
either = { version = "1.4", default-features = false, optional = true }

futures-core/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
//! Core traits and types for asynchronous operations in Rust.
22
33
#![feature(futures_api)]
4-
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]
4+
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
55

66
#![cfg_attr(not(feature = "std"), no_std)]
77

88
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
99

1010
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.12/futures_core")]
1111

12+
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))]
13+
compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features");
14+
1215
pub mod future;
1316
#[doc(hidden)] pub use self::future::{Future, FusedFuture, TryFuture};
1417

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#[cfg_attr(
2-
feature = "nightly",
2+
feature = "cfg-target-has-atomic",
33
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
44
)]
55
mod atomic_waker;
66
#[cfg_attr(
7-
feature = "nightly",
7+
feature = "cfg-target-has-atomic",
88
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
99
)]
1010
pub use self::atomic_waker::AtomicWaker;

futures-util/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ compat = ["std", "futures_01"]
2121
io-compat = ["compat", "tokio-io"]
2222
bench = []
2323
nightly = []
24+
cfg-target-has-atomic = []
2425

2526
[dependencies]
2627
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.12", default-features = false }

futures-util/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
44
#![feature(futures_api, box_into_pin)]
55
#![cfg_attr(feature = "std", feature(async_await, await_macro))]
6-
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]
6+
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
77

88
#![cfg_attr(not(feature = "std"), no_std)]
99
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
1010

1111
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.12/futures_util")]
1212

13+
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))]
14+
compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features");
15+
1316
#[macro_use]
1417
mod macros;
1518

futures-util/src/task/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod local_waker_ref;
1212
pub use self::local_waker_ref::{local_waker_ref, local_waker_ref_from_nonlocal, LocalWakerRef};
1313

1414
#[cfg_attr(
15-
feature = "nightly",
15+
feature = "cfg-target-has-atomic",
1616
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
1717
)]
1818
pub use futures_core::task::__internal::AtomicWaker;

futures/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ std = ["futures-core-preview/std", "futures-executor-preview/std", "futures-io-p
4141
default = ["std"]
4242
compat = ["std", "futures-util-preview/compat"]
4343
io-compat = ["compat", "futures-util-preview/io-compat"]
44+
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-util-preview/cfg-target-has-atomic"]

futures/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.12/futures")]
3131

32-
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]
33-
3432
#[doc(hidden)] pub use futures_util::core_reexport;
3533

3634
#[doc(hidden)] pub use futures_core::future::Future;

0 commit comments

Comments
 (0)