docs: tokio::main macro is also supported on rt (#3243)

Fixes: #3144
Refs: #2225
This commit is contained in:
Florian Hübsch
2020-12-19 19:12:08 +01:00
committed by GitHub
parent b99b00eb30
commit e41e6cddbb
2 changed files with 9 additions and 10 deletions
+2
View File
@@ -53,6 +53,8 @@ use proc_macro::TokenStream;
/// The `worker_threads` option configures the number of worker threads, and
/// defaults to the number of cpus on the system. This is the default flavor.
///
/// Note: The multi-threaded runtime requires the `rt-multi-thread` feature flag.
///
/// # Current thread runtime
///
/// To use the single-threaded runtime known as the `current_thread` runtime,
+7 -10
View File
@@ -453,17 +453,14 @@ cfg_macros! {
pub use tokio_macros::select_priv_declare_output_enum;
cfg_rt! {
cfg_rt_multi_thread! {
// This is the docs.rs case (with all features) so make sure macros
// is included in doc(cfg).
#[cfg(feature = "rt-multi-thread")]
#[cfg(not(test))] // Work around for rust-lang/rust#62127
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
pub use tokio_macros::main;
#[cfg(not(test))] // Work around for rust-lang/rust#62127
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
pub use tokio_macros::main;
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
pub use tokio_macros::test;
}
#[cfg(feature = "rt-multi-thread")]
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
pub use tokio_macros::test;
cfg_not_rt_multi_thread! {
#[cfg(not(test))] // Work around for rust-lang/rust#62127