Skip to content

Commit b040de5

Browse files
committed
tokio-macros: use hidden cfg for local docs
1 parent 4363203 commit b040de5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tokio-macros/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ use proc_macro::TokenStream;
7171
/// To use the single-threaded runtime known as the `current_thread` runtime,
7272
/// the macro can be configured using
7373
///
74-
/// ```
74+
/// ```rust
7575
/// #[tokio::main(flavor = "current_thread")]
7676
/// # async fn main() {}
7777
/// ```
@@ -82,7 +82,8 @@ use proc_macro::TokenStream;
8282
///
8383
/// To use the [local runtime], the macro can be configured using
8484
///
85-
/// ```ignore
85+
/// ```rust
86+
/// # #[cfg(tokio_unstable)]
8687
/// #[tokio::main(flavor = "local")]
8788
/// # async fn main() {}
8889
/// ```
@@ -148,7 +149,8 @@ use proc_macro::TokenStream;
148149
/// The [local runtime] is similar to the current-thread runtime but
149150
/// supports [`task::spawn_local`](../tokio/task/fn.spawn_local.html).
150151
///
151-
/// ```ignore
152+
/// ```rust
153+
/// # #[cfg(tokio_unstable)]
152154
/// #[tokio::main(flavor = "local")]
153155
/// async fn main() {
154156
/// println!("Hello world");
@@ -157,7 +159,8 @@ use proc_macro::TokenStream;
157159
///
158160
/// Equivalent code not using `#[tokio::main]`
159161
///
160-
/// ```ignore
162+
/// ```rust
163+
/// # #[cfg(tokio_unstable)]
161164
/// fn main() {
162165
/// tokio::runtime::Builder::new_current_thread()
163166
/// .enable_all()

0 commit comments

Comments
 (0)