summaryrefslogtreecommitdiffstats
path: root/tokio/src/lib.rs
diff options
context:
space:
mode:
authorDavid Kellum <dek-oss@gravitext.com>2020-02-26 10:38:54 -0800
committerGitHub <noreply@github.com>2020-02-26 10:38:54 -0800
commita4c4ac254b36c5b78038d416e3b78912df293f8f (patch)
treef2f542d05843320ee376c38c5dc71a473ace19df /tokio/src/lib.rs
parent0589acc9ffb9175647d6b7a794edd8812f79399f (diff)
docs: macros doc(cfg) workarounds (#2225)
This is a workaround for the fact that the doc(cfg) from outer cfg_* macros doesn't get applied correctly. Its included in the rt-threaded branch only, which is what is used for doc.rs via all-features.
Diffstat (limited to 'tokio/src/lib.rs')
-rw-r--r--tokio/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs
index 6ea1ee38..036d1036 100644
--- a/tokio/src/lib.rs
+++ b/tokio/src/lib.rs
@@ -356,8 +356,14 @@ cfg_macros! {
doc_rt_core! {
cfg_rt_threaded! {
+ // This is the docs.rs case (with all features) so make sure macros
+ // is included in doc(cfg).
+
#[cfg(not(test))] // Work around for rust-lang/rust#62127
+ #[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
pub use tokio_macros::main_threaded as main;
+
+ #[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
pub use tokio_macros::test_threaded as test;
}