MaybeUninit impls are unsound #299
Labels
blocking-next-release
This issue should be resolved before we release on crates.io
compatibility-breaking
Changes that are (likely to be) breaking
Since
FromZeroes
andFromBytes
banUnsafeCell
s, and since rust-lang/unsafe-code-guidelines#455 implies that there's no way to "disable" interior mutability, our impls ofFromZeroes
andFromBytes
forMaybeUninit<T>
with no bounds onT
are unsound. See also this discussion.One option we may want to consider is introducing a
NoCell
trait that is a super-trait of all of our traits (other thanUnaligned
) so that we can do e.g.impl<T: NoCell> FromBytes for MaybeUninit<T>
.A note on semver: When releasing this, it's doubtful that anyone is relying on this behavior. We may want to just release 0.7.X (whatever the next patch version is at the time of releasing) and yank the previous 0.7.Y versions.
The text was updated successfully, but these errors were encountered: