mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
+10
-10
@@ -7,9 +7,6 @@ mod assert;
|
||||
#[macro_use]
|
||||
mod cfg;
|
||||
|
||||
#[macro_use]
|
||||
mod join;
|
||||
|
||||
#[macro_use]
|
||||
mod loom;
|
||||
|
||||
@@ -19,16 +16,19 @@ mod pin;
|
||||
#[macro_use]
|
||||
mod ready;
|
||||
|
||||
cfg_macros! {
|
||||
#[macro_use]
|
||||
mod select;
|
||||
}
|
||||
|
||||
#[macro_use]
|
||||
mod thread_local;
|
||||
|
||||
#[macro_use]
|
||||
mod try_join;
|
||||
cfg_macros! {
|
||||
#[macro_use]
|
||||
mod select;
|
||||
|
||||
#[macro_use]
|
||||
mod join;
|
||||
|
||||
#[macro_use]
|
||||
mod try_join;
|
||||
}
|
||||
|
||||
// Includes re-exports needed to implement macros
|
||||
#[doc(hidden)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user