diff --git a/tokio-threadpool/src/blocking.rs b/tokio-threadpool/src/blocking.rs index c224f9e01..d75ed13ea 100644 --- a/tokio-threadpool/src/blocking.rs +++ b/tokio-threadpool/src/blocking.rs @@ -6,7 +6,6 @@ use std::error::Error; use std::fmt; /// Error raised by `blocking`. -#[derive(Debug)] pub struct BlockingError { _p: (), } @@ -156,6 +155,14 @@ impl fmt::Display for BlockingError { } } +impl fmt::Debug for BlockingError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("BlockingError") + .field("reason", &self.description()) + .finish() + } +} + impl Error for BlockingError { fn description(&self) -> &str { "`blocking` annotation used from outside the context of a thread pool"