diff --git a/crates/futures/src/lib.rs b/crates/futures/src/lib.rs index 3711a666..ca35b0ab 100644 --- a/crates/futures/src/lib.rs +++ b/crates/futures/src/lib.rs @@ -378,7 +378,14 @@ fn _future_to_promise(future: Box>) -> P } } -/// Spawns a future. +/// Converts a Rust `Future` on a local task queue. +/// +/// The `future` provided must adhere to `'static` because it'll be scheduled +/// to run in the background and cannot contain any stack references. +/// +/// # Panics +/// +/// This function has the same panic behavior as `future_to_promise`. pub fn spawn_local(future: F) where F: Future + 'static,