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