about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMarco A L Barbosa <malbarbo@gmail.com>2017-11-20 14:41:53 -0200
committerMarco A L Barbosa <malbarbo@gmail.com>2017-11-20 15:43:07 -0200
commitcbcaf736f820f33f619d3c9fe3d997e9e69d779e (patch)
tree225c293dac717de4fbf595efe8ee488170ecc6c3 /src/liballoc
parent26e881d00fee7f28bdb7f0562dbcb7f24db43d1a (diff)
downloadrust-cbcaf736f820f33f619d3c9fe3d997e9e69d779e.tar.gz
rust-cbcaf736f820f33f619d3c9fe3d997e9e69d779e.zip
Print the address of the pointed value in Pointer impl for Rc and Arc
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs2
-rw-r--r--src/liballoc/rc.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 9481cd4e1a4..fc0a3c0fd88 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -1328,7 +1328,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Arc<T> {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: ?Sized> fmt::Pointer for Arc<T> {
     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 2f8620cc750..72b9fa0eb47 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -1072,7 +1072,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Rc<T> {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: ?Sized> fmt::Pointer for Rc<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::Pointer::fmt(&self.ptr, f)
+        fmt::Pointer::fmt(&(&**self as *const T), f)
     }
 }