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
alloc: restrict impl ZeroableOption for Box to T: Sized
Similar to what was done for `Zeroable<NonNull<T>>` in commit 9caa350
("last docs changes and zeroable unsized pointer fixes"), the latest Rust
documentation [1] says it guarantees that `transmute::<_, Option<T>>([0u8;
size_of::<T>()])` is sound and produces `Option::<T>::None` only in some
cases. In particular, it says:
`Box<U>` (specifically, only `Box<U, Global>`) when `U: Sized`
Thus restrict the `impl` to `Sized`, and use similar wording as in that
commit too.
Link: https://doc.rust-lang.org/stable/std/option/index.html#representation [1]
Signed-off-by: Miguel Ojeda <[email protected]>
0 commit comments