1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 02:59:01 +02:00

add track_caller atrtibute to spawn calls (#454)

* add track_caller attribute to spawn calls

* fix ci
This commit is contained in:
Rob Ede
2022-04-25 21:05:48 +01:00
committed by GitHub
parent dc67ba770d
commit 4c1e581a54
6 changed files with 20 additions and 4 deletions

View File

@ -53,6 +53,7 @@ impl Runtime {
/// # Panics
/// This function panics if the spawn fails. Failure occurs if the executor is currently at
/// capacity and is unable to spawn a new future.
#[track_caller]
pub fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where
F: Future + 'static,
@ -73,6 +74,7 @@ impl Runtime {
///
/// The caller is responsible for ensuring that other spawned futures complete execution by
/// calling `block_on` or `run`.
#[track_caller]
pub fn block_on<F>(&self, f: F) -> F::Output
where
F: Future,