From cbcaf736f820f33f619d3c9fe3d997e9e69d779e Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Mon, 20 Nov 2017 14:41:53 -0200 Subject: [PATCH] Print the address of the pointed value in Pointer impl for Rc and Arc --- src/liballoc/arc.rs | 2 +- src/liballoc/rc.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) } }