You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsT-langRelevant to the language team, which will review and decide on the PR/issue.T-opsemRelevant to the opsem team
In #115333, we added a guarantee that transmuting from [u8; N] to Option<P> is sound where P is a pointer type subject to the null pointer optimization (NPO). It would be useful to be able to guarantee the inverse - that if all of the bytes of P are initialized, then all of the bytes of None::<P> (and thus all of the bytes of anyOption<P>) are initialized. For example, this would allow zerocopy to support safe transmutation from Option<P> to [u8; N] (google/zerocopy#596).
I'm opening this issue first rather than a PR so there's an opportunity to discuss whether this is something we want, how it would be best to document it, etc.
The text was updated successfully, but these errors were encountered:
saethlin
added
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
T-opsem
Relevant to the opsem team
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Nov 4, 2023
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsT-langRelevant to the language team, which will review and decide on the PR/issue.T-opsemRelevant to the opsem team
In #115333, we added a guarantee that transmuting from
[u8; N]
toOption<P>
is sound whereP
is a pointer type subject to the null pointer optimization (NPO). It would be useful to be able to guarantee the inverse - that if all of the bytes ofP
are initialized, then all of the bytes ofNone::<P>
(and thus all of the bytes of anyOption<P>
) are initialized. For example, this would allow zerocopy to support safe transmutation fromOption<P>
to[u8; N]
(google/zerocopy#596).I'm opening this issue first rather than a PR so there's an opportunity to discuss whether this is something we want, how it would be best to document it, etc.
The text was updated successfully, but these errors were encountered: