-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
A-in-place-initArea: in-place initializationArea: in-place initializationA-rust-for-linuxRelevant for the Rust-for-Linux projectRelevant for the Rust-for-Linux projectC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-partial_init_locals`#[feature(partial_init_locals)]``#[feature(partial_init_locals)]`T-langRelevant to the language teamRelevant to the language team
Description
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
- Implement the feature, see Allow phased initializing structs #152774
- Adjust documentation (see instructions on rustc-dev-guide)
- Style updates for any new syntax (nightly-style-procedure)
- Style team decision on new formatting
- Formatting for new syntax has been added to the Style Guide
- (non-blocking) Formatting has been implemented in
rustfmt
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
Implementation history
- Initial implementation in Allow phased initializing structs #152774
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-in-place-initArea: in-place initializationArea: in-place initializationA-rust-for-linuxRelevant for the Rust-for-Linux projectRelevant for the Rust-for-Linux projectC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-partial_init_locals`#[feature(partial_init_locals)]``#[feature(partial_init_locals)]`T-langRelevant to the language teamRelevant to the language team