summaryrefslogtreecommitdiffstats
path: root/tokio/src/macros
diff options
context:
space:
mode:
authorLucio Franco <luciofranco14@gmail.com>2020-10-12 13:44:54 -0400
committerGitHub <noreply@github.com>2020-10-12 13:44:54 -0400
commit8880222036f37c6204c8466f25e828447f16dacb (patch)
treefd623afc20f73bbce65746a3d1b1b2731ecf30a5 /tokio/src/macros
parent0893841f31542b2b04c5050a8a4a3c45cf867e55 (diff)
rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876)
Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Carl Lerche <me@carllerche.com>
Diffstat (limited to 'tokio/src/macros')
-rw-r--r--tokio/src/macros/cfg.rs90
-rw-r--r--tokio/src/macros/mod.rs2
-rw-r--r--tokio/src/macros/support.rs3
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;
}