summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tokio-macros/src/lib.rs19
-rw-r--r--tokio/src/lib.rs6
2 files changed, 16 insertions, 9 deletions
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);
/// }
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;
}