2019-04-22 07:40:08 +00:00
|
|
|
// Currently, we do permit you to assign to individual fields of an
|
|
|
|
// uninitialized var.
|
2018-08-11 10:15:58 +00:00
|
|
|
// We hope to fix this at some point.
|
|
|
|
//
|
2018-12-17 16:38:42 +00:00
|
|
|
// FIXME(#54987)
|
2018-08-11 10:15:58 +00:00
|
|
|
|
|
|
|
fn assign_both_fields_and_use() {
|
|
|
|
let mut x: (u32, u32);
|
2019-04-22 07:40:08 +00:00
|
|
|
x.0 = 1; //~ ERROR
|
2018-08-11 10:15:58 +00:00
|
|
|
x.1 = 22;
|
2019-04-22 07:40:08 +00:00
|
|
|
drop(x.0);
|
|
|
|
drop(x.1);
|
2018-08-11 10:15:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn assign_both_fields_the_use_var() {
|
|
|
|
let mut x: (u32, u32);
|
2019-04-22 07:40:08 +00:00
|
|
|
x.0 = 1; //~ ERROR
|
2018-08-11 10:15:58 +00:00
|
|
|
x.1 = 22;
|
2019-04-22 07:40:08 +00:00
|
|
|
drop(x);
|
2018-08-11 10:15:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|