Skip to content

Commit 3f3bcdc

Browse files
committed
alloc: impl fmt::Pointer for Rc and Arc
Closes rust-lang#24091
1 parent b2e65ee commit 3f3bcdc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/liballoc/arc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,13 @@ impl<T: fmt::Debug> fmt::Debug for Arc<T> {
668668
}
669669
}
670670

671+
#[stable(feature = "rust1", since = "1.0.0")]
672+
impl<T> fmt::Pointer for Arc<T> {
673+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
674+
fmt::Pointer::fmt(&*self._ptr, f)
675+
}
676+
}
677+
671678
#[stable(feature = "rust1", since = "1.0.0")]
672679
impl<T: Default + Sync + Send> Default for Arc<T> {
673680
#[stable(feature = "rust1", since = "1.0.0")]

src/liballoc/rc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,13 @@ impl<T: fmt::Debug> fmt::Debug for Rc<T> {
634634
}
635635
}
636636

637+
#[stable(feature = "rust1", since = "1.0.0")]
638+
impl<T> fmt::Pointer for Rc<T> {
639+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
640+
fmt::Pointer::fmt(&*self._ptr, f)
641+
}
642+
}
643+
637644
/// A weak version of `Rc<T>`.
638645
///
639646
/// Weak references do not count when determining if the inner value should be

0 commit comments

Comments
 (0)