2018-10-11 18:33:08 -05:00
|
|
|
error[E0381]: assign of possibly uninitialized variable: `d`
|
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:30:5
|
|
|
|
|
|
|
|
|
LL | d.x = 10;
|
|
|
|
| ^^^^^^^^ use of possibly uninitialized `d`
|
|
|
|
|
|
|
|
error[E0381]: assign of possibly uninitialized variable: `d`
|
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:36:5
|
|
|
|
|
|
|
|
|
LL | d.x = 10;
|
|
|
|
| ^^^^^^^^ use of possibly uninitialized `d`
|
|
|
|
|
|
|
|
error[E0382]: assign of moved value: `d`
|
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:43:5
|
|
|
|
|
|
2019-01-02 18:43:08 -06: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 18:33:08 -05:00
|
|
|
LL | drop(d);
|
|
|
|
| - value moved here
|
|
|
|
LL | d.x = 10;
|
|
|
|
| ^^^^^^^^ value assigned here after move
|
|
|
|
|
|
|
|
error[E0381]: assign to part of possibly uninitialized variable: `d`
|
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:49:5
|
|
|
|
|
|
|
|
|
LL | d.s.y = 20;
|
|
|
|
| ^^^^^^^^^^ use of possibly uninitialized `d.s`
|
|
|
|
|
|
|
|
error[E0381]: assign to part of possibly uninitialized variable: `d`
|
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:55:5
|
|
|
|
|
|
|
|
|
LL | d.s.y = 20;
|
|
|
|
| ^^^^^^^^^^ use of possibly uninitialized `d.s`
|
|
|
|
|
|
|
|
error[E0382]: assign to part of moved value: `d`
|
|
|
|
--> $DIR/issue-21232-partial-init-and-erroneous-use.rs:62:5
|
|
|
|
|
|
2019-01-02 18:43:08 -06: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 18:33:08 -05: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 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0381, E0382.
|
2018-10-11 18:33:08 -05:00
|
|
|
For more information about an error, try `rustc --explain E0381`.
|