提交 ba1a4933 编写于 作者: A Alex Burka

impl Debug for raw pointers to unsized data

上级 50932b5f
......@@ -1566,11 +1566,11 @@ fn fmt(&self, fmt: &mut Formatter) -> Result {
// Implementation of Display/Debug for various core types
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Debug for *const T {
impl<T: ?Sized> Debug for *const T {
fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Debug for *mut T {
impl<T: ?Sized> Debug for *mut T {
fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
}
......
......@@ -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())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册