diff --git a/tokio/src/task/spawn.rs b/tokio/src/task/spawn.rs index 23a46d745..a4498f473 100644 --- a/tokio/src/task/spawn.rs +++ b/tokio/src/task/spawn.rs @@ -161,14 +161,14 @@ cfg_rt! { /// error[E0391]: cycle detected when processing `main` /// ``` #[track_caller] - pub fn spawn(future: T) -> JoinHandle + pub fn spawn(future: F) -> JoinHandle where - T: Future + Send + 'static, - T::Output: Send + 'static, + F: Future + Send + 'static, + F::Output: Send + 'static, { // preventing stack overflows on debug mode, by quickly sending the // task to the heap. - if cfg!(debug_assertions) && std::mem::size_of::() > 2048 { + if cfg!(debug_assertions) && std::mem::size_of::() > 2048 { spawn_inner(Box::pin(future), None) } else { spawn_inner(future, None)