From ba1a49337f8408279e6773818ba4b8215762cb31 Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Sat, 1 Oct 2016 01:50:56 +0000 Subject: [PATCH] impl Debug for raw pointers to unsized data --- src/libcore/fmt/mod.rs | 4 ++-- src/test/run-pass/deriving-show.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index a9f53d3abb8..9aba6703386 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -1566,11 +1566,11 @@ floating! { f64 } // Implementation of Display/Debug for various core types #[stable(feature = "rust1", since = "1.0.0")] -impl Debug for *const T { +impl Debug for *const T { fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) } } #[stable(feature = "rust1", since = "1.0.0")] -impl Debug for *mut T { +impl Debug for *mut T { fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) } } diff --git a/src/test/run-pass/deriving-show.rs b/src/test/run-pass/deriving-show.rs index 1f30f3ecedc..e858ba8c823 100644 --- a/src/test/run-pass/deriving-show.rs +++ b/src/test/run-pass/deriving-show.rs @@ -24,6 +24,9 @@ enum Enum { StructVariant { x: isize, y : usize } } +#[derive(Debug)] +struct Pointers(*const Send, *mut Sync); + macro_rules! t { ($x:expr, $expected:expr) => { assert_eq!(format!("{:?}", $x), $expected.to_string())