diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs index 2b22493c4a..8db010a16b 100644 --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -58,6 +58,8 @@ unused_parens, while_true )] +// TODO: once `tracing` bumps its MSRV to 1.42, remove this allow. +#![allow(unused)] extern crate proc_macro; use std::collections::HashSet; diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index 18dcd341d5..8311997bec 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -413,13 +413,6 @@ impl fmt::Display for FromEnvError { } impl Error for FromEnvError { - fn description(&self) -> &str { - match self.kind { - ErrorKind::Parse(ref p) => p.description(), - ErrorKind::Env(ref e) => e.description(), - } - } - fn source(&self) -> Option<&(dyn Error + 'static)> { match self.kind { ErrorKind::Parse(ref p) => Some(p), diff --git a/tracing-subscriber/src/reload.rs b/tracing-subscriber/src/reload.rs index 700dad9e7e..961f60acb3 100644 --- a/tracing-subscriber/src/reload.rs +++ b/tracing-subscriber/src/reload.rs @@ -228,15 +228,12 @@ impl Error { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - error::Error::description(self).fmt(f) - } -} - -impl error::Error for Error { - fn description(&self) -> &str { - match self.kind { + let msg = match self.kind { ErrorKind::SubscriberGone => "subscriber no longer exists", ErrorKind::Poisoned => "lock poisoned", - } + }; + f.pad(msg) } } + +impl error::Error for Error {}