diff --git a/tokio/src/park/mod.rs b/tokio/src/park/mod.rs index 5db26ce7e..edd937100 100644 --- a/tokio/src/park/mod.rs +++ b/tokio/src/park/mod.rs @@ -41,6 +41,7 @@ cfg_rt! { #[cfg(any(feature = "rt", feature = "sync"))] pub(crate) mod thread; +use std::fmt::Debug; use std::sync::Arc; use std::time::Duration; @@ -50,7 +51,7 @@ pub(crate) trait Park { type Unpark: Unpark; /// Error returned by `park` - type Error; + type Error: Debug; /// Gets a new `Unpark` handle associated with this `Park` instance. fn unpark(&self) -> Self::Unpark; diff --git a/tokio/src/runtime/basic_scheduler.rs b/tokio/src/runtime/basic_scheduler.rs index b26c45d3a..25c0537bf 100644 --- a/tokio/src/runtime/basic_scheduler.rs +++ b/tokio/src/runtime/basic_scheduler.rs @@ -221,7 +221,7 @@ impl Inner

{ Some(task) => crate::coop::budget(|| task.run()), None => { // Park until the thread is signaled - scheduler.park.park().ok().expect("failed to park"); + scheduler.park.park().expect("failed to park"); // Try polling the `block_on` future next continue 'outer; @@ -234,7 +234,6 @@ impl Inner

{ scheduler .park .park_timeout(Duration::from_millis(0)) - .ok() .expect("failed to park"); } })