diff options
author | Carl Lerche <me@carllerche.com> | 2020-01-29 11:16:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 11:16:58 -0800 |
commit | 6232c74724ab05fe164e95a8985065f44b5973bd (patch) | |
tree | 7b318f9cead8e9b18264b00ed374f3a8d8f4e917 /tokio/src/macros | |
parent | be832f20cb30bc014cd2518617d9a7ce72f6480c (diff) |
macros: correctly feature gate join/try_join (#2196)
The `macros` feature flag was ommitted despite the fact that these
macros require the feature flag to function. The macros are now scoped
by the `macros` feature flag.
This is *not* a breaking change due to the fact that the macros were
broken without the `macros` feature flag in the first place.
Diffstat (limited to 'tokio/src/macros')
-rw-r--r-- | tokio/src/macros/join.rs | 1 | ||||
-rw-r--r-- | tokio/src/macros/mod.rs | 16 | ||||
-rw-r--r-- | tokio/src/macros/select.rs | 1 | ||||
-rw-r--r-- | tokio/src/macros/try_join.rs | 1 |
4 files changed, 11 insertions, 8 deletions
diff --git a/tokio/src/macros/join.rs b/tokio/src/macros/join.rs index 68da021e..5f37af51 100644 --- a/tokio/src/macros/join.rs +++ b/tokio/src/macros/join.rs @@ -53,6 +53,7 @@ /// } /// ``` #[macro_export] +#[cfg_attr(docsrs, doc(cfg(feature = "macros")))] macro_rules! join { (@ { // One `_` for each branch in the `join!` macro. This is not used once diff --git a/tokio/src/macros/mod.rs b/tokio/src/macros/mod.rs index 85420d21..a37b3e49 100644 --- a/tokio/src/macros/mod.rs +++ b/tokio/src/macros/mod.rs @@ -8,9 +8,6 @@ mod assert; mod cfg; #[macro_use] -mod join; - -#[macro_use] mod loom; #[macro_use] @@ -19,16 +16,19 @@ mod pin; #[macro_use] mod ready; +#[macro_use] +mod thread_local; + cfg_macros! { #[macro_use] mod select; -} -#[macro_use] -mod thread_local; + #[macro_use] + mod join; -#[macro_use] -mod try_join; + #[macro_use] + mod try_join; +} // Includes re-exports needed to implement macros #[doc(hidden)] diff --git a/tokio/src/macros/select.rs b/tokio/src/macros/select.rs index ddb16f5d..30b2b171 100644 --- a/tokio/src/macros/select.rs +++ b/tokio/src/macros/select.rs @@ -281,6 +281,7 @@ /// } /// ``` #[macro_export] +#[cfg_attr(docsrs, doc(cfg(feature = "macros")))] macro_rules! select { // Uses a declarative macro to do **most** of the work. While it is possible // to implement fully with a declarative macro, a procedural macro is used diff --git a/tokio/src/macros/try_join.rs b/tokio/src/macros/try_join.rs index 9624e7f6..fa5850ef 100644 --- a/tokio/src/macros/try_join.rs +++ b/tokio/src/macros/try_join.rs @@ -60,6 +60,7 @@ /// } /// ``` #[macro_export] +#[cfg_attr(docsrs, doc(cfg(feature = "macros")))] macro_rules! try_join { (@ { // One `_` for each branch in the `try_join!` macro. This is not used once |