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).