From f6ec96542c837d4af486992f6edaeab2c111a351 Mon Sep 17 00:00:00 2001 From: David Lattimore Date: Tue, 31 Oct 2023 06:59:57 +1100 Subject: [PATCH] Track caller when spawning async tasks (#174) This allows separate calls to `spawn` to show separately in tokio-console, rather than having it show all tasks as originating from the `spawn` function itself. --- src/async_rt/task/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/async_rt/task/mod.rs b/src/async_rt/task/mod.rs index e0c1b46..bc001e4 100644 --- a/src/async_rt/task/mod.rs +++ b/src/async_rt/task/mod.rs @@ -5,6 +5,7 @@ pub use join_handle::JoinHandle; use std::any::Any; use std::future::Future; +#[track_caller] pub fn spawn(task: T) -> JoinHandle where T: Future + Send + 'static,