diff options
| author | Marco A L Barbosa <malbarbo@gmail.com> | 2017-11-20 14:41:53 -0200 |
|---|---|---|
| committer | Marco A L Barbosa <malbarbo@gmail.com> | 2017-11-20 15:43:07 -0200 |
| commit | cbcaf736f820f33f619d3c9fe3d997e9e69d779e (patch) | |
| tree | 225c293dac717de4fbf595efe8ee488170ecc6c3 /src/liballoc | |
| parent | 26e881d00fee7f28bdb7f0562dbcb7f24db43d1a (diff) | |
| download | rust-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.rs | 2 | ||||
| -rw-r--r-- | 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 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) } } |
