Skip to content

Commit ac96b3b

Browse files
taiki-ecramertj
authored andcommitted
Make async-await feature not depend on std feature
1 parent f2b6b87 commit ac96b3b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ matrix:
126126
- cargo build --manifest-path futures/Cargo.toml
127127
--target thumbv7m-none-eabi
128128
--no-default-features
129-
--features nightly,alloc
129+
--features alloc
130130

131131
- name: cargo check (futures-util)
132132
rust: nightly
@@ -150,6 +150,7 @@ matrix:
150150
- cargo check --manifest-path futures-util/Cargo.toml --no-default-features
151151
- cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features sink
152152
- cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features alloc,sink
153+
- cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features nightly,async-await
153154

154155
- name: cargo doc
155156
rust: nightly

futures-util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "futures_util"
1818
default = ["std"]
1919
std = ["alloc", "futures-core-preview/std", "slab"]
2020
alloc = ["futures-core-preview/alloc"]
21-
async-await = ["std"]
21+
async-await = []
2222
compat = ["std", "futures_01"]
2323
io-compat = ["io", "compat", "tokio-io"]
2424
bench = []

futures-util/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ extern crate futures_core;
3030
pub use futures_core::ready;
3131
pub use pin_utils::pin_mut;
3232

33+
#[cfg(feature = "std")]
3334
#[cfg(feature = "async-await")]
3435
#[macro_use]
3536
#[doc(hidden)]
3637
pub mod async_await;
38+
#[cfg(feature = "std")]
3739
#[cfg(feature = "async-await")]
3840
#[doc(hidden)]
3941
pub use self::async_await::*;
4042

43+
#[cfg(feature = "std")]
4144
#[cfg(feature = "select-macro")]
4245
#[doc(hidden)]
4346
pub mod rand_reexport { // used by select!

futures/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` featu
6767
// Macro reexports
6868
pub use futures_core::ready; // Readiness propagation
6969
pub use futures_util::pin_mut;
70+
#[cfg(feature = "std")]
7071
#[cfg(feature = "async-await")]
7172
pub use futures_util::{pending, poll}; // Async-await
7273

@@ -515,10 +516,12 @@ pub mod never {
515516

516517
// proc-macro re-export --------------------------------------
517518

519+
#[cfg(feature = "std")]
518520
#[cfg(feature = "async-await")]
519521
#[doc(hidden)]
520522
pub use futures_util::rand_reexport;
521523

524+
#[cfg(feature = "std")]
522525
#[cfg(feature = "async-await")]
523526
#[doc(hidden)]
524527
pub mod inner_macro {
@@ -527,6 +530,7 @@ pub mod inner_macro {
527530
pub use futures_util::select;
528531
}
529532

533+
#[cfg(feature = "std")]
530534
#[cfg(feature = "async-await")]
531535
futures_util::document_join_macro! {
532536
#[macro_export]
@@ -550,6 +554,7 @@ futures_util::document_join_macro! {
550554
}
551555
}
552556

557+
#[cfg(feature = "std")]
553558
#[cfg(feature = "async-await")]
554559
futures_util::document_select_macro! {
555560
#[macro_export]

0 commit comments

Comments
 (0)