External Publication
Visit Post

Another Experiment To Make Unsafe Rust Safer: Preventing UB In MaybeUninit With Compile Time Error

Rust Internals [Unofficial] May 23, 2026
Source
Yeah, I though enum will zeroed memory earlier :[ What I learned so far: * enum does not zeroed memory * heap types does not zeroed memory, stack array does * tuple depends on the type, if it is heap it does not zeroed, if it is stack array it does Yeah, option uses branching aka runtime check. Plus option can not be initialized partially This approach have no branching, but it needs 2 types because it is what makes the compiler can catch the mistake at compile time

Discussion in the ATmosphere

Loading comments...