diff options
Diffstat (limited to 'tokio/src/macros')
-rw-r--r-- | tokio/src/macros/cfg.rs | 90 | ||||
-rw-r--r-- | tokio/src/macros/mod.rs | 2 | ||||
-rw-r--r-- | tokio/src/macros/support.rs | 3 |
3 files changed, 15 insertions, 80 deletions
diff --git a/tokio/src/macros/cfg.rs b/tokio/src/macros/cfg.rs index 8f1536f8..83102da6 100644 --- a/tokio/src/macros/cfg.rs +++ b/tokio/src/macros/cfg.rs @@ -1,70 +1,10 @@ #![allow(unused_macros)] -macro_rules! cfg_resource_drivers { - ($($item:item)*) => { - $( - #[cfg(any( - feature = "process", - all(unix, feature = "signal"), - all(not(loom), feature = "tcp"), - feature = "time", - all(not(loom), feature = "udp"), - all(not(loom), feature = "uds"), - ))] - $item - )* - } -} - -macro_rules! cfg_blocking { - ($($item:item)*) => { - $( - #[cfg(feature = "blocking")] - #[cfg_attr(docsrs, doc(cfg(feature = "blocking")))] - $item - )* - } -} - -/// Enables blocking API internals -macro_rules! cfg_blocking_impl { - ($($item:item)*) => { - $( - #[cfg(any( - feature = "blocking", - feature = "fs", - feature = "dns", - feature = "io-std", - feature = "rt-threaded", - ))] - $item - )* - } -} - -/// Enables blocking API internals -macro_rules! cfg_blocking_impl_or_task { - ($($item:item)*) => { - $( - #[cfg(any( - feature = "blocking", - feature = "fs", - feature = "dns", - feature = "io-std", - feature = "rt-threaded", - feature = "task", - ))] - $item - )* - } -} - /// Enables enter::block_on macro_rules! cfg_block_on { ($($item:item)*) => { $( #[cfg(any( - feature = "blocking", feature = "fs", feature = "dns", feature = "io-std", @@ -75,29 +15,13 @@ macro_rules! cfg_block_on { } } -/// Enables blocking API internals -macro_rules! cfg_not_blocking_impl { - ($($item:item)*) => { - $( - #[cfg(not(any( - feature = "blocking", - feature = "fs", - feature = "dns", - feature = "io-std", - feature = "rt-threaded", - )))] - $item - )* - } -} - /// Enables internal `AtomicWaker` impl macro_rules! cfg_atomic_waker_impl { ($($item:item)*) => { $( #[cfg(any( feature = "process", - all(feature = "rt-core", feature = "rt-util"), + feature = "rt-util", feature = "signal", feature = "tcp", feature = "time", @@ -324,6 +248,16 @@ macro_rules! cfg_rt_core { } } +macro_rules! cfg_task { + ($($item:item)*) => { + $( + #[cfg(any(feature = "rt-core", feature = "rt-util"))] + #[cfg_attr(docsrs, doc(cfg(any(feature = "rt-core", feature = "rt-util"))))] + $item + )* + } +} + macro_rules! doc_rt_core { ($($item:item)*) => { $( @@ -451,12 +385,12 @@ macro_rules! cfg_coop { ($($item:item)*) => { $( #[cfg(any( - feature = "blocking", feature = "dns", feature = "fs", feature = "io-std", feature = "process", feature = "rt-core", + feature = "rt-util", feature = "signal", feature = "sync", feature = "stream", diff --git a/tokio/src/macros/mod.rs b/tokio/src/macros/mod.rs index 2643c360..a9d87657 100644 --- a/tokio/src/macros/mod.rs +++ b/tokio/src/macros/mod.rs @@ -16,7 +16,7 @@ mod ready; mod thread_local; #[macro_use] -#[cfg(feature = "rt-core")] +#[cfg(any(feature = "rt-core", feature = "rt-util"))] pub(crate) mod scoped_tls; cfg_macros! { diff --git a/tokio/src/macros/support.rs b/tokio/src/macros/support.rs index fc1cdfcf..7f11bc68 100644 --- a/tokio/src/macros/support.rs +++ b/tokio/src/macros/support.rs @@ -1,5 +1,6 @@ cfg_macros! { - pub use crate::future::{maybe_done, poll_fn}; + pub use crate::future::poll_fn; + pub use crate::future::maybe_done::maybe_done; pub use crate::util::thread_rng_n; } |