From d2799d791b10388e60a2a5fe5e4a33b3336e1465 Mon Sep 17 00:00:00 2001 From: Mattia Pitossi Date: Sun, 4 Jan 2026 12:58:03 +0100 Subject: [PATCH] task: improve the docs of `Builder::spawn_local` (#7828) --- tokio/src/runtime/scheduler/current_thread/mod.rs | 2 +- tokio/src/task/builder.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tokio/src/runtime/scheduler/current_thread/mod.rs b/tokio/src/runtime/scheduler/current_thread/mod.rs index bdf15f6ed..305f9a5d0 100644 --- a/tokio/src/runtime/scheduler/current_thread/mod.rs +++ b/tokio/src/runtime/scheduler/current_thread/mod.rs @@ -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 diff --git a/tokio/src/task/builder.rs b/tokio/src/task/builder.rs index 467a70064..c253e853e 100644 --- a/tokio/src/task/builder.rs +++ b/tokio/src/task/builder.rs @@ -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`.