Auto merge of #46647 - varkor:contrib-1, r=sfackler
Add `std::fmt::Pointer` implementation for `AtomicPtr` Resolves #29212.
This commit is contained in:
commit
707d070815
1 changed files with 8 additions and 0 deletions
|
@ -1819,3 +1819,11 @@ impl<T> fmt::Debug for AtomicPtr<T> {
|
||||||
f.debug_tuple("AtomicPtr").field(&self.load(Ordering::SeqCst)).finish()
|
f.debug_tuple("AtomicPtr").field(&self.load(Ordering::SeqCst)).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_has_atomic = "ptr")]
|
||||||
|
#[stable(feature = "atomic_pointer", since = "1.24.0")]
|
||||||
|
impl<T> fmt::Pointer for AtomicPtr<T> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
fmt::Pointer::fmt(&self.load(Ordering::SeqCst), f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue