summaryrefslogtreecommitdiffstats
path: root/vendor/tracing-core/src/dispatcher.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
commit17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch)
tree3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /vendor/tracing-core/src/dispatcher.rs
parentAdding upstream version 1.64.0+dfsg1. (diff)
downloadrustc-f7f0cc2a5d72e2c61c1f6900e70eec992bea4273.tar.xz
rustc-f7f0cc2a5d72e2c61c1f6900e70eec992bea4273.zip
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/tracing-core/src/dispatcher.rs')
-rw-r--r--vendor/tracing-core/src/dispatcher.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/tracing-core/src/dispatcher.rs b/vendor/tracing-core/src/dispatcher.rs
index 041722c36..a3661817c 100644
--- a/vendor/tracing-core/src/dispatcher.rs
+++ b/vendor/tracing-core/src/dispatcher.rs
@@ -293,14 +293,21 @@ pub fn has_been_set() -> bool {
}
/// Returned if setting the global dispatcher fails.
-#[derive(Debug)]
pub struct SetGlobalDefaultError {
_no_construct: (),
}
+impl fmt::Debug for SetGlobalDefaultError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ f.debug_tuple("SetGlobalDefaultError")
+ .field(&Self::MESSAGE)
+ .finish()
+ }
+}
+
impl fmt::Display for SetGlobalDefaultError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- f.pad("a global default trace dispatcher has already been set")
+ f.pad(Self::MESSAGE)
}
}
@@ -308,6 +315,10 @@ impl fmt::Display for SetGlobalDefaultError {
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
impl error::Error for SetGlobalDefaultError {}
+impl SetGlobalDefaultError {
+ const MESSAGE: &'static str = "a global default trace dispatcher has already been set";
+}
+
/// Executes a closure with a reference to this thread's current [dispatcher].
///
/// Note that calls to `get_default` should not be nested; if this function is