mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
impl Debug for raw pointers to unsized data
This commit is contained in:
parent
50932b5f4e
commit
ba1a49337f
@ -1566,11 +1566,11 @@ floating! { f64 }
|
||||
// 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())
|
||||
|
Loading…
Reference in New Issue
Block a user