diff --git a/src/runtime.rs b/src/runtime.rs index 373bbec85..f76f9e308 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -54,6 +54,7 @@ pub(crate) use tls::TlsConfig; /// /// This must be called from an async block /// or function running on a runtime. +#[track_caller] pub(crate) fn spawn(fut: F) -> AsyncJoinHandle where F: Future + Send + 'static, diff --git a/src/runtime/join_handle.rs b/src/runtime/join_handle.rs index 7e74d23d7..9bf413833 100644 --- a/src/runtime/join_handle.rs +++ b/src/runtime/join_handle.rs @@ -9,6 +9,7 @@ use std::{ pub(crate) struct AsyncJoinHandle(tokio::task::JoinHandle); impl AsyncJoinHandle { + #[track_caller] pub(crate) fn spawn(fut: F) -> Self where F: Future + Send + 'static,