Skip to content

std::repr does not work properly for packed fields #13486

Closed
@stepancheg

Description

@stepancheg

Problem with std::repr (and with std::reflect) is that TyVisitor does not tell whether struct is packed or not.

I think, proper solution would be adding offset parameter to fn visit_class_field(...) callback, to remove all complex offsets/alignment computation code from libstd (because it is already done in librustc).

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