task: improve the docs of Builder::spawn_local (#7828)

This commit is contained in:
Mattia Pitossi
2026-01-04 19:58:03 +08:00
committed by GitHub
parent 4d4870f291
commit d2799d791b
2 changed files with 3 additions and 3 deletions
@@ -499,7 +499,7 @@ impl Handle {
F: crate::future::Future + 'static,
F::Output: 'static,
{
// Safety: the caller guarantees that the this is only called on a `LocalRuntime`.
// Safety: the caller guarantees that this is only called on a `LocalRuntime`.
let (handle, notified) = unsafe {
me.shared
.owned
+2 -2
View File
@@ -20,7 +20,7 @@ use std::{future::Future, io, mem};
/// the task
///
/// There are three types of task that can be spawned from a Builder:
/// - [`spawn_local`] for executing futures on the current thread
/// - [`spawn_local`] for executing not [`Send`] futures
/// - [`spawn`] for executing [`Send`] futures on the runtime
/// - [`spawn_blocking`] for executing blocking code in the
/// blocking thread pool.
@@ -118,7 +118,7 @@ impl<'a> Builder<'a> {
})
}
/// Spawns `!Send` a task on the current [`LocalSet`] or [`LocalRuntime`] with
/// Spawns a `!Send` task on the current [`LocalSet`] or [`LocalRuntime`] with
/// this builder's settings.
///
/// The spawned future will be run on the same thread that called `spawn_local`.