diff --git a/tokio/src/signal/windows/sys.rs b/tokio/src/signal/windows/sys.rs index f2c93e66373..53090f0ab46 100644 --- a/tokio/src/signal/windows/sys.rs +++ b/tokio/src/signal/windows/sys.rs @@ -188,40 +188,40 @@ mod tests { } #[test] - fn ctrl_shutdown() { - let rt = rt(); + fn ctrl_shutdown() { + let rt = rt(); - rt.block_on(async { - let mut ctrl_shutdown = assert_ok!(crate::signal::windows::ctrl_shutdown()); + rt.block_on(async { + let mut ctrl_shutdown = assert_ok!(crate::signal::windows::ctrl_shutdown()); - // Windows doesn't have a good programmatic way of sending events - // like sending signals on Unix, so we'll stub out the actual OS - // integration and test that our handling works. - unsafe { - super::handler(wincon::CTRL_SHUTDOWN_EVENT); - } + // Windows doesn't have a good programmatic way of sending events + // like sending signals on Unix, so we'll stub out the actual OS + // integration and test that our handling works. + unsafe { + super::handler(wincon::CTRL_SHUTDOWN_EVENT); + } - ctrl_shutdown.recv().await.unwrap(); - }); - } + ctrl_shutdown.recv().await.unwrap(); + }); + } #[test] - fn ctrl_logoff() { - let rt = rt(); - - rt.block_on(async { - let mut ctrl_logoff = assert_ok!(crate::signal::windows::ctrl_logoff()); - - // Windows doesn't have a good programmatic way of sending events - // like sending signals on Unix, so we'll stub out the actual OS - // integration and test that our handling works. - unsafe { - super::handler(wincon::CTRL_LOGOFF_EVENT); - } - - ctrl_logoff.recv().await.unwrap(); - }); - } + fn ctrl_logoff() { + let rt = rt(); + + rt.block_on(async { + let mut ctrl_logoff = assert_ok!(crate::signal::windows::ctrl_logoff()); + + // Windows doesn't have a good programmatic way of sending events + // like sending signals on Unix, so we'll stub out the actual OS + // integration and test that our handling works. + unsafe { + super::handler(wincon::CTRL_LOGOFF_EVENT); + } + + ctrl_logoff.recv().await.unwrap(); + }); + } fn rt() -> Runtime { crate::runtime::Builder::new_current_thread() diff --git a/tokio/src/task/join_set.rs b/tokio/src/task/join_set.rs index 44730347408..b10b5a6b456 100644 --- a/tokio/src/task/join_set.rs +++ b/tokio/src/task/join_set.rs @@ -439,7 +439,7 @@ impl<'a, T: 'static> Builder<'a, T> { /// [`AbortHandle`]: crate::task::AbortHandle /// [runtime handle]: crate::runtime::Handle #[track_caller] - pub fn spawn_on(mut self, future: F, handle: &Handle) -> std::io::Result + pub fn spawn_on(self, future: F, handle: &Handle) -> std::io::Result where F: Future, F: Send + 'static,