This is a tracking issue for the RFC "XXX" (rust-lang/rfcs#NNN).
The feature gate for the issue is #![feature(partial_init_locals)].
This is a small subgoal for the experiment rust-lang/lang-team#336.
This feature is to partially undo #54986 on a sane set-up. Types with no Drop can be sanely initialised gradually one field at a time.
struct A {
a: u8,
b: (u64, u64),
}
let data: A;
data.b.0 = 0;
//~ `data` not initialised
data.b.1 = 1;
//~ `data` still not initialised, but `data.b` is
data.a = 0;
// `data` is fully initialised.
data.a = 1;
//~ ERROR `data` is not mutable.
Steps
Unresolved Questions
Implementation history
This is a tracking issue for the RFC "XXX" (rust-lang/rfcs#NNN).The feature gate for the issue is
#![feature(partial_init_locals)].This is a small subgoal for the experiment rust-lang/lang-team#336.
This feature is to partially undo #54986 on a sane set-up. Types with no
Dropcan be sanely initialised gradually one field at a time.Steps
rustfmtUnresolved Questions
Implementation history