2018-08-08 14:28:26 +02:00
|
|
|
error[E0423]: expected value, found struct `UnitStruct`
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:29:14
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let us = UnitStruct;
|
|
|
|
| ^^^^^^^^^^ constructor is not visible here due to private fields
|
|
|
|
|
2019-10-11 17:38:20 +03:00
|
|
|
error[E0603]: tuple struct constructor `TupleStruct` is private
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:23:32
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let ts_explicit = structs::TupleStruct(640, 480);
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^^^^^^^^^^^ private tuple struct constructor
|
2021-06-10 13:52:00 +02:00
|
|
|
|
|
2021-09-10 16:45:04 -04:00
|
|
|
::: $DIR/auxiliary/structs.rs:12:24
|
2019-08-09 12:52:02 -07:00
|
|
|
|
|
2019-10-09 17:37:48 +03:00
|
|
|
LL | pub struct TupleStruct(pub u16, pub u16);
|
2019-10-11 22:00:15 +03:00
|
|
|
| ---------------- a constructor is private if any of the fields is private
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the tuple struct constructor `TupleStruct` is defined here
|
2021-09-10 16:45:04 -04:00
|
|
|
--> $DIR/auxiliary/structs.rs:12:1
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
LL | pub struct TupleStruct(pub u16, pub u16);
|
2022-02-13 16:27:59 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error[E0603]: unit struct `UnitStruct` is private
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:32:32
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let us_explicit = structs::UnitStruct;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^^^^^^^^^^ private unit struct
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
note: the unit struct `UnitStruct` is defined here
|
2021-09-10 16:45:04 -04:00
|
|
|
--> $DIR/auxiliary/structs.rs:9:1
|
2020-01-12 16:04:03 +03:00
|
|
|
|
|
|
|
|
LL | pub struct UnitStruct;
|
2022-02-13 16:27:59 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error[E0639]: cannot create non-exhaustive struct using struct expression
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:7:14
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let fr = FunctionalRecord {
|
|
|
|
| ______________^
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | |
|
2018-08-08 14:28:26 +02:00
|
|
|
LL | | first_field: 1920,
|
|
|
|
LL | | second_field: 1080,
|
|
|
|
LL | | ..FunctionalRecord::default()
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error[E0639]: cannot create non-exhaustive struct using struct expression
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:14:14
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let ns = NormalStruct { first_field: 640, second_field: 480 };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0638]: `..` required with struct marked as non-exhaustive
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:17:9
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let NormalStruct { first_field, second_field } = ns;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-03-25 08:35:17 +01:00
|
|
|
|
|
2020-03-26 02:29:42 +01:00
|
|
|
help: add `..` at the end of the field list to ignore all other fields
|
2020-03-25 08:35:17 +01:00
|
|
|
|
|
|
|
|
LL | let NormalStruct { first_field, second_field , .. } = ns;
|
2021-06-21 19:07:19 -07:00
|
|
|
| ~~~~~~
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2022-10-05 05:35:34 +00:00
|
|
|
error[E0423]: cannot initialize a tuple struct which contains private fields
|
|
|
|
--> $DIR/struct.rs:20:14
|
|
|
|
|
|
|
|
|
LL | let ts = TupleStruct(640, 480);
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
error[E0638]: `..` required with struct marked as non-exhaustive
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:26:9
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let TupleStruct { 0: first_field, 1: second_field } = ts;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-03-25 08:35:17 +01:00
|
|
|
|
|
2020-03-26 02:29:42 +01:00
|
|
|
help: add `..` at the end of the field list to ignore all other fields
|
2020-03-25 08:35:17 +01:00
|
|
|
|
|
|
|
|
LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts;
|
2021-06-21 19:07:19 -07:00
|
|
|
| ~~~~~~
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error[E0638]: `..` required with struct marked as non-exhaustive
|
2019-03-22 17:19:12 +01:00
|
|
|
--> $DIR/struct.rs:35:9
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
LL | let UnitStruct { } = us;
|
|
|
|
| ^^^^^^^^^^^^^^
|
2020-03-25 08:35:17 +01:00
|
|
|
|
|
2020-03-26 02:29:42 +01:00
|
|
|
help: add `..` at the end of the field list to ignore all other fields
|
2020-03-25 08:35:17 +01:00
|
|
|
|
|
|
|
|
LL | let UnitStruct { .. } = us;
|
2021-06-21 19:07:19 -07:00
|
|
|
| ~~~~
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|
2019-04-17 13:26:38 -04:00
|
|
|
Some errors have detailed explanations: E0423, E0603, E0638, E0639.
|
2018-08-08 14:28:26 +02:00
|
|
|
For more information about an error, try `rustc --explain E0423`.
|