Skip to content

Add T: ?Sized to mem::align_of #50948

@joshlf

Description

@joshlf

mem::align_of currently requires that T: Sized. This bound is unnecessary, and prevents align_of from being used in generic code that operates on unsized types. mem::align_of_val is available, but only works when an instance of T is present to be passed.

I propose that we make align_of specify where T: ?Sized.

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