Implement write() method for Box<MaybeUninit> by Kixunil · Pull Request #88906 · rust-lang/rust (original) (raw)
I believe this change is simple and obvious.
To point out why this change isn't simple and obvious: this is a breaking change. It can make previously working code fail to compile, or keep compiling but do the wrong thing, or silently introduce UB into existing correct code.
Here is an example of an ordinary idiomatic use of MaybeUninit which would no longer work:
struct Thing { buf: Box<MaybeUninit<[u8; N]>>, }
impl Thing { fn method(&mut self) { let _arr = self.buf.write([0; N]); } }