Skip to content

Move ready! macro to futures-core from futures-util #1699

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

Merged
merged 2 commits into from
Jul 1, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions futures-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@ pub mod future;
pub mod stream;
#[doc(hidden)] pub use self::stream::{Stream, FusedStream, TryStream};

#[macro_use]
pub mod task;
#[doc(hidden)] pub use self::task::Poll;

#[doc(hidden)]
pub mod core_reexport {
#[doc(hidden)]
pub use core::*;
}
6 changes: 5 additions & 1 deletion futures-core/src/task/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
//! Task notification.

#[macro_use]
mod poll;

mod spawn;
pub use self::spawn::{Spawn, LocalSpawn, SpawnError};

#[doc(hidden)]
pub mod __internal;
pub use self::spawn::{Spawn, LocalSpawn, SpawnError};

pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
File renamed without changes.
20 changes: 14 additions & 6 deletions futures-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ compile_error!("The `async-await` feature requires the `nightly` feature as an e
#[cfg(feature = "alloc")]
extern crate alloc;

#[macro_use]
mod macros;
#[macro_use(ready)]
extern crate futures_core;

// Re-export pin_mut! for convenience
// Macro re-exports
pub use futures_core::ready;
pub use pin_utils::pin_mut;

#[cfg(feature = "async-await")]
Expand All @@ -49,9 +50,16 @@ pub mod rand_reexport { // used by select!
}

#[doc(hidden)]
pub mod core_reexport {
#[doc(hidden)]
pub use core::*;
pub use futures_core::core_reexport;

macro_rules! cfg_target_has_atomic {
($($item:item)*) => {$(
#[cfg_attr(
feature = "cfg-target-has-atomic",
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
)]
$item
)*};
}

macro_rules! delegate_sink {
Expand Down
12 changes: 0 additions & 12 deletions futures-util/src/macros/mod.rs

This file was deleted.

4 changes: 2 additions & 2 deletions futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` featu
#[cfg(all(feature = "never-type", not(feature = "nightly")))]
compile_error!("The `never-type` feature requires the `nightly` feature as an explicit opt-in to unstable features");

#[doc(hidden)] pub use futures_util::core_reexport;
#[doc(hidden)] pub use futures_core::core_reexport;

#[doc(hidden)] pub use futures_core::future::Future;
#[doc(hidden)] pub use futures_core::future::TryFuture;
Expand All @@ -67,8 +67,8 @@ compile_error!("The `never-type` feature requires the `nightly` feature as an ex
#[doc(hidden)] pub use futures_core::task::Poll;

// Macro reexports
pub use futures_core::ready; // Readiness propagation
pub use futures_util::pin_mut;
pub use futures_util::ready; // Readiness propagation
#[cfg(feature = "async-await")]
pub use futures_util::{
// Async-await
Expand Down