Make clear that status quo ≠ guarantee

This commit is contained in:
Peter Todd 2019-05-18 22:27:33 -04:00
parent aa1db2476a
commit a91ad60158
No known key found for this signature in database
GPG Key ID: 2481403DA5F091FB

View File

@ -6,8 +6,9 @@
// For example, if a union `U` can contain both a `&T` and a `*const T`, there's definitely no // For example, if a union `U` can contain both a `&T` and a `*const T`, there's definitely no
// bit-value that an `Option<U>` could reuse as `None`; this test makes sure that isn't done. // bit-value that an `Option<U>` could reuse as `None`; this test makes sure that isn't done.
// //
// Secondly, this tests the status quo to not apply such optimizations to types containing unions // Secondly, this tests the status quo (not a guarantee; subject to change!) to not apply such
// even if they're theoretically possible. (discussion: https://github.com/rust-lang/rust/issues/36394) // optimizations to types containing unions even if they're theoretically possible. (discussion:
// https://github.com/rust-lang/rust/issues/36394)
// //
// Notably this nails down part of the behavior that `MaybeUninit` assumes: that a // Notably this nails down part of the behavior that `MaybeUninit` assumes: that a
// `Option<MaybeUninit<&u8>>` does not take advantage of non-zero optimization, and thus is a safe // `Option<MaybeUninit<&u8>>` does not take advantage of non-zero optimization, and thus is a safe