1
Fork 0

Rollup merge of #46121 - malbarbo:rc_arc_pointer, r=dtolnay

Print the address of the pointed value in Pointer impl for Rc and Arc

Fixes https://github.com/rust-lang/rust/issues/35384
This commit is contained in:
kennytm 2017-11-21 03:14:46 +08:00 committed by GitHub
commit 04b9c25002
2 changed files with 2 additions and 2 deletions

View file

@ -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)
}
}

View file

@ -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)
}
}