2022-06-23 10:42:17 -07:00
|
|
|
error[E0381]: used binding `a` isn't initialized
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/borrowck-uninit-field-access.rs:21:13
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2022-06-21 11:57:45 -07:00
|
|
|
LL | let mut a: Point;
|
2022-06-21 15:54:17 -07:00
|
|
|
| ----- binding declared here but left uninitialized
|
2019-03-17 10:52:07 +01:00
|
|
|
LL | let _ = a.x + 1;
|
2022-06-21 11:57:45 -07:00
|
|
|
| ^^^ `a.x` used here but it isn't initialized
|
2022-09-23 15:28:48 +08:00
|
|
|
|
|
|
|
|
help: consider assigning a value
|
|
|
|
|
|
|
|
|
LL | let mut a: Point = Default::default();
|
|
|
|
| ++++++++++++++++++++
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2018-10-16 17:08:59 +02:00
|
|
|
error[E0382]: use of moved value: `line1.origin`
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/borrowck-uninit-field-access.rs:25:13
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let _moved = line1.origin;
|
|
|
|
| ------------ value moved here
|
2019-03-17 10:52:07 +01:00
|
|
|
LL | let _ = line1.origin.x + 1;
|
2018-08-08 14:28:26 +02:00
|
|
|
| ^^^^^^^^^^^^^^ value used here after move
|
|
|
|
|
|
|
|
|
= note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait
|
|
|
|
|
2020-08-08 13:16:43 -04:00
|
|
|
error[E0382]: use of partially moved value: `line2`
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/borrowck-uninit-field-access.rs:29:5
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let _moved = (line2.origin, line2.middle);
|
2020-08-08 13:16:43 -04:00
|
|
|
| ------------ value partially moved here
|
2019-03-17 10:52:07 +01:00
|
|
|
LL | line2.consume();
|
2019-02-05 13:56:29 -07:00
|
|
|
| ^^^^^ value used here after partial move
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2020-08-08 13:16:43 -04:00
|
|
|
= note: partial move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
2019-04-17 13:26:38 -04:00
|
|
|
Some errors have detailed explanations: E0381, E0382.
|
2018-08-08 14:28:26 +02:00
|
|
|
For more information about an error, try `rustc --explain E0381`.
|