TECH Signal 401
Proposal outlines four-level hierarchy for Rust in-place initialization
Illustration only Photo by Claudio Schwarz on Unsplash
A blog post proposes addressing Rust's in-place initialization problem through a four-level feature hierarchy rather than a single language feature, ranging from raw pointers to more ergonomic abstractions.
In-place initialization is essential for large types and address-sensitive types that cannot be moved for correctness, but current approaches require unsafe code or lack expressiveness. The hierarchy framework could shape how the Rust language evolves to handle emplacement, affecting both performance and safety guarantees for systems programmers.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Level 0 uses raw pointers and MaybeUninit, which is flexible but requires unsafe and lacks compiler verification of correctness.
Level 1 proposes &uninit/&own reference pairs that make uninitialized places first-class and safe to pass across function boundaries, with compiler-checked correctness.
Level 2 introduces placing functions that rewrite the return keyword to write to an out-pointer, prioritizing ergonomics over fine-grained control.
THE CLUSTER