Skip to content

Commit

Permalink
Make async-await feature not depend on std feature
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and cramertj committed Aug 20, 2019
1 parent f2b6b87 commit ac96b3b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -126,7 +126,7 @@ matrix:
- cargo build --manifest-path futures/Cargo.toml
--target thumbv7m-none-eabi
--no-default-features
--features nightly,alloc
--features alloc

- name: cargo check (futures-util)
rust: nightly
Expand All @@ -150,6 +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

- name: cargo doc
rust: nightly
Expand Down
2 changes: 1 addition & 1 deletion futures-util/Cargo.toml
Expand Up @@ -18,7 +18,7 @@ name = "futures_util"
default = ["std"]
std = ["alloc", "futures-core-preview/std", "slab"]
alloc = ["futures-core-preview/alloc"]
async-await = ["std"]
async-await = []
compat = ["std", "futures_01"]
io-compat = ["io", "compat", "tokio-io"]
bench = []
Expand Down
3 changes: 3 additions & 0 deletions futures-util/src/lib.rs
Expand Up @@ -30,14 +30,17 @@ extern crate futures_core;
pub use futures_core::ready;
pub use pin_utils::pin_mut;

#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
#[macro_use]
#[doc(hidden)]
pub mod async_await;
#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
#[doc(hidden)]
pub use self::async_await::*;

#[cfg(feature = "std")]
#[cfg(feature = "select-macro")]
#[doc(hidden)]
pub mod rand_reexport { // used by select!
Expand Down
5 changes: 5 additions & 0 deletions futures/src/lib.rs
Expand Up @@ -67,6 +67,7 @@ compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` featu
// Macro reexports
pub use futures_core::ready; // Readiness propagation
pub use futures_util::pin_mut;
#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
pub use futures_util::{pending, poll}; // Async-await

Expand Down Expand Up @@ -515,10 +516,12 @@ pub mod never {

// proc-macro re-export --------------------------------------

#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
#[doc(hidden)]
pub use futures_util::rand_reexport;

#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
#[doc(hidden)]
pub mod inner_macro {
Expand All @@ -527,6 +530,7 @@ pub mod inner_macro {
pub use futures_util::select;
}

#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
futures_util::document_join_macro! {
#[macro_export]
Expand All @@ -550,6 +554,7 @@ futures_util::document_join_macro! {
}
}

#[cfg(feature = "std")]
#[cfg(feature = "async-await")]
futures_util::document_select_macro! {
#[macro_export]
Expand Down

0 comments on commit ac96b3b

Please sign in to comment.