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:
I've submitted rust-lang/rust#115333 to clarify the representation of Options and hopefully unblock more of this issue.
Some
Optiontypes have known layouts/bit validity (e.g.,Option<&T>whereT: 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 thatNoneis represented as a sequence of zeroes, then it should be sound to implementFromZeroesfor these types.Task:
T, for which we can implementFromZeroes for Option<T>(EDIT: Here's a breadcrumb)I've submitted rust-lang/rust#115333 to clarify the representation of
Options and hopefully unblock more of this issue.