summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2022-10-26 22:40:58 -0400
committerBotahamec <botahamec@outlook.com>2022-10-26 22:40:58 -0400
commit3bae2353944d5b3686ee7b3d4a5527fb37d5565f (patch)
treef712e46e6866416e3034f12900458083889c31e8 /src
parent083eb5c3161f10192638abd0b29a687e4a285a60 (diff)
Manually implement Debug
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 248cdcc..a2a3f5c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,5 @@
+use std::fmt::{self, Debug};
+
use parking_lot::Mutex;
thread_local! {
@@ -5,11 +7,16 @@ thread_local! {
pub static KEY: Mutex<Option<ThreadKey>> = Mutex::new(Some(unsafe { ThreadKey::new() }));
}
-#[derive(Debug)]
pub struct ThreadKey {
_priv: *const (), // this isn't Send or Sync
}
+impl Debug for ThreadKey {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ "ThreadKey".fmt(f)
+ }
+}
+
impl ThreadKey {
unsafe fn new() -> Self {
Self {