mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
docs: tokio::main macro is also supported on rt (#3243)
Fixes: #3144 Refs: #2225
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user