{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicfh5zjfep67szqsjyzoqyynuy6uyur5aefgcgdu67uultmxtbtxm",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mmjtmkjjsg62"
},
"path": "/t/another-experiment-to-make-unsafe-rust-safer-preventing-ub-in-maybeuninit-with-compile-time-error/24352#post_10",
"publishedAt": "2026-05-23T15:31:05.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Yeah, I though enum will zeroed memory earlier :[\n\nWhat I learned so far:\n\n * enum does not zeroed memory\n * heap types does not zeroed memory, stack array does\n * tuple depends on the type, if it is heap it does not zeroed, if it is stack array it does\n\n\n\nYeah, option uses branching aka runtime check. Plus option can not be initialized partially\n\nThis approach have no branching, but it needs 2 types because it is what makes the compiler can catch the mistake at compile time",
"title": "Another Experiment To Make Unsafe Rust Safer: Preventing UB In MaybeUninit With Compile Time Error"
}