diff options
author | Taiki Endo <te316e89@gmail.com> | 2020-10-13 06:13:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 14:13:23 -0700 |
commit | c90681bd8e629b5fde988b9f5be7b915e5cf8ae5 (patch) | |
tree | e70838b9437123dc986ebcfeb8fc0c44ca3fe667 /tokio/src/macros | |
parent | 24d0a0cfa8916eaef17f40f044d978aa3904d654 (diff) |
rt: simplify rt-* features (#2949)
tokio:
merge rt-core and rt-util as rt
rename rt-threaded to rt-multi-thread
tokio-util:
rename rt-core to rt
Closes #2942
Diffstat (limited to 'tokio/src/macros')
-rw-r--r-- | tokio/src/macros/cfg.rs | 56 | ||||
-rw-r--r-- | tokio/src/macros/mod.rs | 2 |
2 files changed, 14 insertions, 44 deletions
diff --git a/tokio/src/macros/cfg.rs b/tokio/src/macros/cfg.rs index 849fb42b..fedef7ad 100644 --- a/tokio/src/macros/cfg.rs +++ b/tokio/src/macros/cfg.rs @@ -8,7 +8,7 @@ macro_rules! cfg_block_on { feature = "fs", feature = "dns", feature = "io-std", - feature = "rt-core", + feature = "rt", ))] $item )* @@ -22,7 +22,7 @@ macro_rules! cfg_atomic_waker_impl { #[cfg(any( feature = "net", feature = "process", - feature = "rt-util", + feature = "rt", feature = "signal", feature = "time", ))] @@ -251,64 +251,35 @@ macro_rules! cfg_not_sync { } } -macro_rules! cfg_rt_core { +macro_rules! cfg_rt { ($($item:item)*) => { $( - #[cfg(feature = "rt-core")] + #[cfg(feature = "rt")] + #[cfg_attr(docsrs, doc(cfg(feature = "rt")))] $item )* } } -macro_rules! cfg_task { +macro_rules! cfg_not_rt { ($($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)*) => { - $( - #[cfg(feature = "rt-core")] - #[cfg_attr(docsrs, doc(cfg(feature = "rt-core")))] - $item - )* - } -} - -macro_rules! cfg_not_rt_core { - ($($item:item)*) => { - $( #[cfg(not(feature = "rt-core"))] $item )* - } -} - -macro_rules! cfg_rt_threaded { - ($($item:item)*) => { - $( - #[cfg(feature = "rt-threaded")] - #[cfg_attr(docsrs, doc(cfg(feature = "rt-threaded")))] - $item - )* + $( #[cfg(not(feature = "rt"))] $item )* } } -macro_rules! cfg_rt_util { +macro_rules! cfg_rt_multi_thread { ($($item:item)*) => { $( - #[cfg(feature = "rt-util")] - #[cfg_attr(docsrs, doc(cfg(feature = "rt-util")))] + #[cfg(feature = "rt-multi-thread")] + #[cfg_attr(docsrs, doc(cfg(feature = "rt-multi-thread")))] $item )* } } -macro_rules! cfg_not_rt_threaded { +macro_rules! cfg_not_rt_multi_thread { ($($item:item)*) => { - $( #[cfg(not(feature = "rt-threaded"))] $item )* + $( #[cfg(not(feature = "rt-multi-thread"))] $item )* } } @@ -372,8 +343,7 @@ macro_rules! cfg_coop { feature = "io-std", feature = "net", feature = "process", - feature = "rt-core", - feature = "rt-util", + feature = "rt", feature = "signal", feature = "sync", feature = "stream", diff --git a/tokio/src/macros/mod.rs b/tokio/src/macros/mod.rs index a9d87657..b0af5215 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(any(feature = "rt-core", feature = "rt-util"))] +#[cfg(feature = "rt")] pub(crate) mod scoped_tls; cfg_macros! { |