2022-06-22 22:36:26 +00:00
|
|
|
error[E0381]: assigned binding `d` isn't fully initialized
|
2019-04-07 15:07:36 +00:00
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:28:5
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
2022-06-21 18:57:45 +00:00
|
|
|
LL | let d: D;
|
2022-06-21 22:54:17 +00:00
|
|
|
| - binding declared here but left uninitialized
|
2018-10-11 23:33:08 +00:00
|
|
|
LL | d.x = 10;
|
2022-06-22 22:36:26 +00:00
|
|
|
| ^^^^^^^^ `d` assigned here but it isn't fully initialized
|
2022-06-23 17:42:17 +00:00
|
|
|
|
|
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-10-11 23:33:08 +00:00
|
|
|
|
2022-06-22 22:36:26 +00:00
|
|
|
error[E0381]: assigned binding `d` isn't fully initialized
|
2022-06-21 18:57:45 +00:00
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:33:5
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
2022-06-21 18:57:45 +00:00
|
|
|
LL | let mut d: D;
|
2022-06-21 22:54:17 +00:00
|
|
|
| ----- binding declared here but left uninitialized
|
2018-10-11 23:33:08 +00:00
|
|
|
LL | d.x = 10;
|
2022-06-22 22:36:26 +00:00
|
|
|
| ^^^^^^^^ `d` assigned here but it isn't fully initialized
|
2022-06-23 17:42:17 +00:00
|
|
|
|
|
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
|
|
error[E0382]: assign of moved value: `d`
|
2022-06-21 18:57:45 +00:00
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:39:5
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
2019-01-03 00:43:08 +00:00
|
|
|
LL | let mut d = D { x: 0, s: S{ y: 0, z: 0 } };
|
|
|
|
| ----- move occurs because `d` has type `D`, which does not implement the `Copy` trait
|
2018-10-11 23:33:08 +00:00
|
|
|
LL | drop(d);
|
|
|
|
| - value moved here
|
|
|
|
LL | d.x = 10;
|
|
|
|
| ^^^^^^^^ value assigned here after move
|
|
|
|
|
2022-06-23 17:42:17 +00:00
|
|
|
error[E0381]: partially assigned binding `d` isn't fully initialized
|
2022-06-21 18:57:45 +00:00
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:45:5
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
2022-06-21 18:57:45 +00:00
|
|
|
LL | let d: D;
|
2022-06-21 22:54:17 +00:00
|
|
|
| - binding declared here but left uninitialized
|
2018-10-11 23:33:08 +00:00
|
|
|
LL | d.s.y = 20;
|
2022-06-21 18:57:45 +00:00
|
|
|
| ^^^^^^^^^^ `d.s` partially assigned here but it isn't fully initialized
|
|
|
|
|
|
2022-06-21 22:54:17 +00:00
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-10-11 23:33:08 +00:00
|
|
|
|
2022-06-23 17:42:17 +00:00
|
|
|
error[E0381]: partially assigned binding `d` isn't fully initialized
|
2022-06-21 18:57:45 +00:00
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:50:5
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
2022-06-21 18:57:45 +00:00
|
|
|
LL | let mut d: D;
|
2022-06-21 22:54:17 +00:00
|
|
|
| ----- binding declared here but left uninitialized
|
2018-10-11 23:33:08 +00:00
|
|
|
LL | d.s.y = 20;
|
2022-06-21 18:57:45 +00:00
|
|
|
| ^^^^^^^^^^ `d.s` partially assigned here but it isn't fully initialized
|
|
|
|
|
|
2022-06-21 22:54:17 +00:00
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
|
|
error[E0382]: assign to part of moved value: `d`
|
2022-06-21 18:57:45 +00:00
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:56:5
|
2018-10-11 23:33:08 +00:00
|
|
|
|
|
2019-01-03 00:43:08 +00:00
|
|
|
LL | let mut d = D { x: 0, s: S{ y: 0, z: 0} };
|
|
|
|
| ----- move occurs because `d` has type `D`, which does not implement the `Copy` trait
|
2018-10-11 23:33:08 +00:00
|
|
|
LL | drop(d);
|
|
|
|
| - value moved here
|
|
|
|
LL | d.s.y = 20;
|
|
|
|
| ^^^^^^^^^^ value partially assigned here after move
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0381, E0382.
|
2018-10-11 23:33:08 +00:00
|
|
|
For more information about an error, try `rustc --explain E0381`.
|