{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidfyro66rhc4iirmyazlbqnn7cjypyhi4voh2mafmtjsgs5j5napi",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mmhd44hzfcl2"
},
"path": "/t/another-experiment-to-make-unsafe-rust-safer-preventing-ub-in-maybeuninit-with-compile-time-error/24352#post_7",
"publishedAt": "2026-05-22T15:36:40.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "For looking at prior art: checked incremental initialization of an array is basically a `Vec<T>` of some sort. See also the `arrayvec` crate. It even provides a method to get a `[T; N]` if the `ArrayVec` is fully initialized. That is, there is nothing to do in that case; an existing crate with hundreds of millions of downloads provides a solution.\n\nChecked incremental initialization of an enum or struct is called the “builder pattern”. There are a variety of crates for builders… I dunno which one is most popular, but, say, `bon` has over 30 million downloads.",
"title": "Another Experiment To Make Unsafe Rust Safer: Preventing UB In MaybeUninit With Compile Time Error"
}