Rollup merge of #36880 - durka:debug-unsized-ptr, r=bluss
impl Debug for raw pointers to unsized data `?Sized` was missing from these impls for seemingly no reason. Fixes #36870.
This commit is contained in:
commit
987aea5ee4
2 changed files with 5 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue