diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 9481cd4e1a4f1..fc0a3c0fd881a 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -1328,7 +1328,7 @@ impl fmt::Debug for Arc { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Pointer for Arc { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::Pointer::fmt(&self.ptr, f) + fmt::Pointer::fmt(&(&**self as *const T), f) } } diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 2f8620cc75051..72b9fa0eb4721 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -1072,7 +1072,7 @@ impl fmt::Debug for Rc { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Pointer for Rc { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::Pointer::fmt(&self.ptr, f) + fmt::Pointer::fmt(&(&**self as *const T), f) } }