Skip to content

Commit 8758965

Browse files
authored
task: fix unstable API documentation notes (#4503)
## Motivation PR #4499 made the `JoinSet` API unstable, but did not add a documentation note explaining unstable features. In general, since the docs.rs build includes unstable APIs, it's probably worth including these notes so that users understand what it means for an API to be unstable. ## Solution This branch adds a note on unstable APIs to the `JoinSet` type-level documentation, similar to the notes for `task::Builder` and the runtime metrics APIs. Also, I noticed that there was a broken link to the top-level documentation on unstable APIs in the docs for `task::Builder`, so I fixed that as well.
1 parent 28b983c commit 8758965

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tokio/src/task/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use std::future::Future;
4949
/// }
5050
/// }
5151
/// ```
52-
/// [unstable API]: crate#unstable-features
52+
/// [unstable]: crate#unstable-features
5353
/// [`name`]: Builder::name
5454
/// [`spawn_local`]: Builder::spawn_local
5555
/// [`spawn`]: Builder::spawn

tokio/src/task/join_set.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ use crate::util::IdleNotifiedSet;
1717
///
1818
/// When the `JoinSet` is dropped, all tasks in the `JoinSet` are immediately aborted.
1919
///
20+
/// **Note**: This is an [unstable API][unstable]. The public API of this type
21+
/// may break in 1.x releases. See [the documentation on unstable
22+
/// features][unstable] for details.
23+
///
2024
/// # Examples
2125
///
2226
/// Spawn multiple tasks and wait for them.
@@ -42,6 +46,8 @@ use crate::util::IdleNotifiedSet;
4246
/// }
4347
/// }
4448
/// ```
49+
///
50+
/// [unstable]: crate#unstable-features
4551
pub struct JoinSet<T> {
4652
inner: IdleNotifiedSet<JoinHandle<T>>,
4753
}

0 commit comments

Comments
 (0)