{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreih3ugxxb5yzqqh77tni4wwjc6hsuersggeskdmbxt27luubridatu",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mmhd4xqyzsl2"
},
"path": "/t/another-experiment-to-make-unsafe-rust-safer-preventing-ub-in-maybeuninit-with-compile-time-error/24352#post_2",
"publishedAt": "2026-05-22T13:10:03.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "To be frank, this doesn’t help whatsoever. `UninitGuard::write` might as well just ignore the `self` parameter -- its contents get overwritten anyway -- in which case you take a `T` and return a fancy guard that just lets you use the inner data as a `T`. If you already have a `T`, you don’t need to do that.\n\nIMO, the best safe equivalent of `MaybeUninit<T>` is `Option<T>`.",
"title": "Another Experiment To Make Unsafe Rust Safer: Preventing UB In MaybeUninit With Compile Time Error"
}