Skip to content

Commit

Permalink
Rollup merge of rust-lang#46121 - malbarbo:rc_arc_pointer, r=dtolnay
Browse files Browse the repository at this point in the history
Print the address of the pointed value in Pointer impl for Rc and Arc

Fixes rust-lang#35384
  • Loading branch information
kennytm authored Nov 20, 2017
2 parents b32d9ad + cbcaf73 commit 04b9c25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 04b9c25

Please sign in to comment.