Skip to content

std::fmt::Pointer should be implemented for pointers to T: ?Sized #30427

Closed
@benw

Description

@benw

Example:

fn main() {
    let x: Box<std::fmt::Debug> = Box::new("hello");
    println!("{:p}", x);
    // error: the trait `core::marker::Sized` is not implemented for the type `core::fmt::Debug`
}

I think Pointer should be impled as follows:

impl<T: ?Sized> Pointer for Box<T>

and likewise for borrowed refs, raw pointers, Arc etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions