From 3bae2353944d5b3686ee7b3d4a5527fb37d5565f Mon Sep 17 00:00:00 2001 From: Botahamec Date: Wed, 26 Oct 2022 22:40:58 -0400 Subject: Manually implement Debug --- src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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> = 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 { -- cgit v1.2.3