Closed
Description
Some Option
types have known layouts/bit validity (e.g., Option<&T>
where T: Sized
). Are these actually guaranteed, or just "in practice everyone knows that's how the compiler does it"? If it's the former, and we know that None
is represented as a sequence of zeroes, then it should be sound to implement FromZeroes
for these types.
Task:
- Find types,
T
, for which we can implementFromZeroes for Option<T>
(EDIT: Here's a breadcrumb) - For each such type, ensure that we can make a bulletproof soundness argument based on the Rust reference and the standard library documentation
- Put up a PR to emit the appropriate impl.
I've submitted rust-lang/rust#115333 to clarify the representation of Option
s and hopefully unblock more of this issue.