]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/disallow-possibly-uninitialized.rs
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / ui / borrowck / disallow-possibly-uninitialized.rs
1 // Test that we don't allow partial initialization.
2 // This may be relaxed in the future (see #54987).
3
4 fn main() {
5     let mut t: (u64, u64);
6     t.0 = 1;
7     //~^ ERROR E0381
8     t.1 = 1;
9
10     let mut t: (u64, u64);
11     t.1 = 1;
12     //~^ ERROR E0381
13     t.0 = 1;
14
15     let mut t: (u64, u64);
16     t.0 = 1;
17     //~^ ERROR E0381
18
19     let mut t: (u64,);
20     t.0 = 1;
21     //~^ ERROR E0381
22 }