diff --git a/futures-core/src/lib.rs b/futures-core/src/lib.rs index 95331a2f29..375c99b5e5 100644 --- a/futures-core/src/lib.rs +++ b/futures-core/src/lib.rs @@ -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::*; +} diff --git a/futures-core/src/task/mod.rs b/futures-core/src/task/mod.rs index 1747b55659..c03d4074f2 100644 --- a/futures-core/src/task/mod.rs +++ b/futures-core/src/task/mod.rs @@ -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}; diff --git a/futures-util/src/macros/poll.rs b/futures-core/src/task/poll.rs similarity index 100% rename from futures-util/src/macros/poll.rs rename to futures-core/src/task/poll.rs diff --git a/futures-util/src/lib.rs b/futures-util/src/lib.rs index a66e4da323..b2308b32bc 100644 --- a/futures-util/src/lib.rs +++ b/futures-util/src/lib.rs @@ -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")] @@ -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 { diff --git a/futures-util/src/macros/mod.rs b/futures-util/src/macros/mod.rs deleted file mode 100644 index 0a9ac422c1..0000000000 --- a/futures-util/src/macros/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -#[macro_use] -mod poll; - -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 - )*}; -} diff --git a/futures/src/lib.rs b/futures/src/lib.rs index 127c736c7b..7807182f8e 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -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; @@ -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