2019-08-03 00:08:16 +00:00
|
|
|
// Test that we don't allow partial initialization.
|
|
|
|
// This may be relaxed in the future (see #54987).
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut t: (u64, u64);
|
|
|
|
t.0 = 1;
|
2019-09-01 17:09:59 +00:00
|
|
|
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
|
2019-08-03 00:08:16 +00:00
|
|
|
t.1 = 1;
|
|
|
|
|
|
|
|
let mut t: (u64, u64);
|
|
|
|
t.1 = 1;
|
2019-09-01 17:09:59 +00:00
|
|
|
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
|
2019-08-03 00:08:16 +00:00
|
|
|
t.0 = 1;
|
|
|
|
|
|
|
|
let mut t: (u64, u64);
|
|
|
|
t.0 = 1;
|
2019-09-01 17:09:59 +00:00
|
|
|
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
|
2019-08-03 00:08:16 +00:00
|
|
|
|
|
|
|
let mut t: (u64,);
|
|
|
|
t.0 = 1;
|
2019-09-01 17:09:59 +00:00
|
|
|
//~^ ERROR assign to part of possibly-uninitialized variable: `t` [E0381]
|
2019-08-03 00:08:16 +00:00
|
|
|
}
|