Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make async-await feature not depend on std feature #1815

Merged
merged 1 commit into from Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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