mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
Add a verbose error message for EnterError (#441)
Add a verbose error message for EnterError while trying to run an executor while another executor is already running. Fixes: #410
This commit is contained in:
@@ -20,11 +20,18 @@ pub struct Enter {
|
||||
|
||||
/// An error returned by `enter` if an execution scope has already been
|
||||
/// entered.
|
||||
#[derive(Debug)]
|
||||
pub struct EnterError {
|
||||
_a: (),
|
||||
}
|
||||
|
||||
impl fmt::Debug for EnterError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.debug_struct("EnterError")
|
||||
.field("reason", &"attempted to run an executor while another executor is already running")
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
/// Marks the current thread as being within the dynamic extent of an
|
||||
/// executor.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user