From ba91aa83d866b9d7bfa0a9b19807f074d56e1c90 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 23 Aug 2019 09:39:54 +0900 Subject: [PATCH] Rename "nightly" feature to "unstable" --- .travis.yml | 8 ++++---- futures-channel/Cargo.toml | 6 +++++- futures-channel/src/lib.rs | 4 ++-- futures-core/Cargo.toml | 8 ++++++-- futures-core/src/lib.rs | 4 ++-- futures-util/Cargo.toml | 10 +++++++--- futures-util/src/lib.rs | 7 +++++-- futures/Cargo.toml | 6 +++++- futures/src/lib.rs | 4 ++-- 9 files changed, 38 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fd4d29bda..7716513128 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,7 +75,7 @@ matrix: rust: nightly script: - cargo bench --all - - cargo bench --manifest-path futures-util/Cargo.toml --features=bench + - cargo bench --manifest-path futures-util/Cargo.toml --features=bench,unstable - name: cargo +stable build --no-default-features rust: stable @@ -108,11 +108,11 @@ matrix: - cargo build --manifest-path futures/Cargo.toml --target thumbv6m-none-eabi --no-default-features - --features nightly,cfg-target-has-atomic + --features unstable,cfg-target-has-atomic - cargo build --manifest-path futures/Cargo.toml --target thumbv6m-none-eabi --no-default-features - --features nightly,alloc,cfg-target-has-atomic + --features unstable,alloc,cfg-target-has-atomic - name: cargo build --target=thumbv7m-none-eabi rust: nightly @@ -150,7 +150,7 @@ matrix: - cargo check --manifest-path futures-util/Cargo.toml --no-default-features - cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features sink - cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features alloc,sink - - cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features nightly,async-await + - cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features async-await - name: cargo doc rust: nightly diff --git a/futures-channel/Cargo.toml b/futures-channel/Cargo.toml index f8111a4c13..1f3b3cb02c 100644 --- a/futures-channel/Cargo.toml +++ b/futures-channel/Cargo.toml @@ -19,7 +19,11 @@ default = ["std"] std = ["alloc", "futures-core-preview/std"] alloc = ["futures-core-preview/alloc"] sink = ["futures-sink-preview"] -nightly = ["futures-core-preview/nightly"] + +# Unstable features +# These features are outside of the normal semver guarantees and require the +# `unstable` feature as an explicit opt-in to unstable API. +unstable = ["futures-core-preview/unstable"] cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"] [dependencies] diff --git a/futures-channel/src/lib.rs b/futures-channel/src/lib.rs index c20637e89f..d421f15b9a 100644 --- a/futures-channel/src/lib.rs +++ b/futures-channel/src/lib.rs @@ -19,8 +19,8 @@ #![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.18/futures_channel")] -#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))] -compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features"); +#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "unstable")))] +compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feature as an explicit opt-in to unstable features"); macro_rules! cfg_target_has_atomic { ($($item:item)*) => {$( diff --git a/futures-core/Cargo.toml b/futures-core/Cargo.toml index a1a549818f..a810628c18 100644 --- a/futures-core/Cargo.toml +++ b/futures-core/Cargo.toml @@ -17,10 +17,14 @@ name = "futures_core" [features] default = ["std"] std = ["alloc"] -nightly = [] -cfg-target-has-atomic = [] alloc = [] +# Unstable features +# These features are outside of the normal semver guarantees and require the +# `unstable` feature as an explicit opt-in to unstable API. +unstable = [] +cfg-target-has-atomic = [] + [dependencies] [dev-dependencies] diff --git a/futures-core/src/lib.rs b/futures-core/src/lib.rs index 2121db2e04..615370d397 100644 --- a/futures-core/src/lib.rs +++ b/futures-core/src/lib.rs @@ -13,8 +13,8 @@ #![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.18/futures_core")] -#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))] -compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features"); +#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "unstable")))] +compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feature as an explicit opt-in to unstable features"); #[cfg(feature = "alloc")] extern crate alloc; diff --git a/futures-util/Cargo.toml b/futures-util/Cargo.toml index 99f677cd48..32654e073b 100644 --- a/futures-util/Cargo.toml +++ b/futures-util/Cargo.toml @@ -21,15 +21,19 @@ alloc = ["futures-core-preview/alloc"] async-await = [] compat = ["std", "futures_01"] io-compat = ["io", "compat", "tokio-io"] -bench = [] -nightly = ["futures-core-preview/nightly"] -cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"] sink = ["futures-sink-preview"] io = ["std", "futures-io-preview", "memchr"] channel = ["std", "futures-channel-preview"] join-macro = ["async-await", "futures-join-macro-preview", "proc-macro-hack", "proc-macro-nested"] select-macro = ["async-await", "futures-select-macro-preview", "proc-macro-hack", "proc-macro-nested", "rand"] +# Unstable features +# These features are outside of the normal semver guarantees and require the +# `unstable` feature as an explicit opt-in to unstable API. +unstable = ["futures-core-preview/unstable"] +cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"] +bench = [] + [dependencies] futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.18", default-features = false } futures-channel-preview = { path = "../futures-channel", version = "=0.3.0-alpha.18", default-features = false, features = ["std"], optional = true } diff --git a/futures-util/src/lib.rs b/futures-util/src/lib.rs index 07734a8b46..db95c297ea 100644 --- a/futures-util/src/lib.rs +++ b/futures-util/src/lib.rs @@ -13,8 +13,11 @@ #![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.18/futures_util")] -#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))] -compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features"); +#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "unstable")))] +compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feature as an explicit opt-in to unstable features"); + +#[cfg(all(feature = "bench", not(feature = "unstable")))] +compile_error!("The `bench` feature requires the `unstable` feature as an explicit opt-in to unstable features"); #[cfg(feature = "alloc")] extern crate alloc; diff --git a/futures/Cargo.toml b/futures/Cargo.toml index 14fe4fdf1e..56d6355bc6 100644 --- a/futures/Cargo.toml +++ b/futures/Cargo.toml @@ -39,10 +39,14 @@ assert_matches = "1.3.0" default = ["std"] std = ["alloc", "futures-core-preview/std", "futures-executor-preview/std", "futures-io-preview/std", "futures-sink-preview/std", "futures-util-preview/std", "futures-util-preview/io", "futures-util-preview/channel"] alloc = ["futures-core-preview/alloc", "futures-sink-preview/alloc", "futures-channel-preview/alloc", "futures-util-preview/alloc"] -nightly = ["futures-core-preview/nightly", "futures-channel-preview/nightly", "futures-util-preview/nightly"] async-await = ["futures-util-preview/async-await", "futures-util-preview/join-macro", "futures-util-preview/select-macro"] compat = ["std", "futures-util-preview/compat"] io-compat = ["compat", "futures-util-preview/io-compat"] + +# Unstable features +# These features are outside of the normal semver guarantees and require the +# `unstable` feature as an explicit opt-in to unstable API. +unstable = ["futures-core-preview/unstable", "futures-channel-preview/unstable", "futures-util-preview/unstable"] cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-channel-preview/cfg-target-has-atomic", "futures-util-preview/cfg-target-has-atomic"] [package.metadata.docs.rs] diff --git a/futures/src/lib.rs b/futures/src/lib.rs index 16da728262..df60e1b60e 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -34,8 +34,8 @@ #![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.18/futures")] -#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))] -compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features"); +#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "unstable")))] +compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feature as an explicit opt-in to unstable features"); #[doc(hidden)] pub use futures_core::core_reexport;