-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
This came up a few weeks ago in libs triage specifically related to #48493 where we were wondering if there were other locations in the standard library that needed to be adjusted to handle uninhabited enums being handled in generic locations. While not many locations in the standard library leapt to mind one thing we thought of was the offset_of!
macro.
For example if we've got something like:
struct Foo<T> { a: T, b: usize }
do existing offset_of!
macros handle this?
offset_of!(Foo<Void>, b)
or is there "technical UB that rustc may paper over today" somewhere in there?
cc @dtolnay, I think you had better ideas about examples here than I!
kennytm, hikalium, Raekye and stepancheg
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.