From a4c4ac254b36c5b78038d416e3b78912df293f8f Mon Sep 17 00:00:00 2001 From: David Kellum Date: Wed, 26 Feb 2020 10:38:54 -0800 Subject: 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. --- tokio-macros/src/lib.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tokio-macros') diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index 19715113..bc8f203a 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -28,8 +28,9 @@ use proc_macro::TokenStream; /// /// ## Options: /// -/// - `core_threads=n` - Sets core threads to `n`. -/// - `max_threads=n` - Sets max threads to `n`. +/// +/// - `core_threads=n` - Sets core threads to `n` (requires `rt-threaded` feature). +/// - `max_threads=n` - Sets max threads to `n` (requires `rt-core` or `rt-threaded` feature). /// /// ## Function arguments: /// @@ -65,7 +66,7 @@ pub fn main_threaded(args: TokenStream, item: TokenStream) -> TokenStream { /// ## Options: /// /// - `basic_scheduler` - All tasks are executed on the current thread. -/// - `threaded_scheduler` - Uses the multi-threaded scheduler. Used by default. +/// - `threaded_scheduler` - Uses the multi-threaded scheduler. Used by default (requires `rt-threaded` feature). /// /// ## Function arguments: /// @@ -126,15 +127,15 @@ pub fn main_basic(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ## Options: /// -/// - `basic_scheduler` - All tasks are executed on the current thread. Used by default. -/// - `threaded_scheduler` - Use multi-threaded scheduler. +/// - `core_threads=n` - Sets core threads to `n` (requires `rt-threaded` feature). +/// - `max_threads=n` - Sets max threads to `n` (requires `rt-core` or `rt-threaded` feature). /// /// ## Usage /// /// ### Select runtime /// /// ```no_run -/// #[tokio::test(threaded_scheduler)] +/// #[tokio::test(core_threads = 1)] /// async fn my_test() { /// assert!(true); /// } @@ -157,15 +158,15 @@ pub fn test_threaded(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ## Options: /// -/// - `core_threads=n` - Sets core threads to `n`. -/// - `max_threads=n` - Sets max threads to `n`. +/// - `basic_scheduler` - All tasks are executed on the current thread. Used by default. +/// - `threaded_scheduler` - Use multi-threaded scheduler (requires `rt-threaded` feature). /// /// ## Usage /// /// ### Select runtime /// /// ```no_run -/// #[tokio::test(core_threads = 1)] +/// #[tokio::test(threaded_scheduler)] /// async fn my_test() { /// assert!(true); /// } -- cgit v1.2.3