]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-union-uninitialized.stderr
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / ui / borrowck / borrowck-union-uninitialized.stderr
1 error[E0381]: partially assigned binding `s` isn't fully initialized
2   --> $DIR/borrowck-union-uninitialized.rs:13:9
3    |
4 LL |         let mut s: S;
5    |             ----- binding declared here but left uninitialized
6 LL |         let mut u: U;
7 LL |         s.a = 0;
8    |         ^^^^^^^ `s` partially assigned here but it isn't fully initialized
9    |
10    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
11
12 error[E0381]: partially assigned binding `u` isn't fully initialized
13   --> $DIR/borrowck-union-uninitialized.rs:14:9
14    |
15 LL |         let mut u: U;
16    |             ----- binding declared here but left uninitialized
17 LL |         s.a = 0;
18 LL |         u.a = 0;
19    |         ^^^^^^^ `u` partially assigned here but it isn't fully initialized
20    |
21    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0381`.