3 ms·
Rust can do it with "unsafe" pointers, but the safe subset of the language lacks ergonomic and foolproof interface for it. Ability to witness uninitialized mem
by pornel 4y ago
Rust can do it with "unsafe" pointers, but the safe subset of the language lacks ergonomic and foolproof interface for it.
Ability to witness uninitialized memory is "unsafe" in Rust. A safe mutable reference is required to point to valid initialized object at all times, no cheating.
In practice Rust usually gets away with not having placement new and letting LLVM eliminate copies.