Allow phased initializing structs#152774
Conversation
|
cc @BennoLossin @nxsaken FYI. |
This comment has been minimized.
This comment has been minimized.
|
Regarding non-exhaustive: I think it's pretty simple, the reference already covers all of this: |
b53c9d8 to
e0f5908
Compare
|
This PR is ready for previewing. It is pending a formal RFC and a tracking issue. |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
e0f5908 to
2658bbf
Compare
This comment has been minimized.
This comment has been minimized.
2658bbf to
7aa064a
Compare
This comment has been minimized.
This comment has been minimized.
7aa064a to
ccc2d22
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
ccc2d22 to
b63adae
Compare
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@rustbot reroll |
|
This code doesn't compile in edition 2024, although I think it probably should: #![feature(partial_init_locals)]
fn main() {
let x: (u8, u8);
x.1 = 1;
let _ = move || {
let (_, _y) = x;
};
}Note that fully initializing Also, changing |
|
The following code doesn't compile in edition 2024, although I think it should. #![feature(partial_init_locals)]
#[repr(C, packed)]
struct Thing(u16, u32);
fn main() {
let x: Thing;
x.1 = 1;
let _ = move || {
let _y = x.1;
};
} |
Partially undoing #54986
This PR introduces an unstable feature
partial_init_nodrop_types. This work corresponds to the new action item in rust-lang/rust-project-goals#548.Action Items
non_exhaustive?