diff --git a/rust/kernel/sync/atomic.rs b/rust/kernel/sync/atomic.rs index 0bc6e7b04d67..3afc376be42d 100644 --- a/rust/kernel/sync/atomic.rs +++ b/rust/kernel/sync/atomic.rs @@ -307,6 +307,15 @@ pub fn store(&self, v: T, _: Ordering) { } } +impl core::fmt::Debug for Atomic +where + T::Repr: AtomicBasicOps, +{ + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::Debug::fmt(&self.load(Relaxed), f) + } +} + impl Atomic where T::Repr: AtomicExchangeOps,