rust/src/test/ui/rfc-2008-non-exhaustive/struct.stderr

70 lines
2.3 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0423]: expected function, found struct `TupleStruct`
--> $DIR/struct.rs:20:14
2018-08-08 07:28:26 -05:00
|
LL | let ts = TupleStruct(640, 480);
| ^^^^^^^^^^^ constructor is not visible here due to private fields
error[E0423]: expected value, found struct `UnitStruct`
--> $DIR/struct.rs:29:14
2018-08-08 07:28:26 -05:00
|
LL | let us = UnitStruct;
| ^^^^^^^^^^ constructor is not visible here due to private fields
error[E0603]: tuple struct constructor `TupleStruct` is private
--> $DIR/struct.rs:23:32
2018-08-08 07:28:26 -05:00
|
LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^
|
::: $DIR/auxiliary/structs.rs:13:24
|
LL | pub struct TupleStruct(pub u16, pub u16);
| ---------------- a tuple struct constructor is private if any of its fields is private
2018-08-08 07:28:26 -05:00
error[E0603]: unit struct `UnitStruct` is private
--> $DIR/struct.rs:32:32
2018-08-08 07:28:26 -05:00
|
LL | let us_explicit = structs::UnitStruct;
| ^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error[E0639]: cannot create non-exhaustive struct using struct expression
--> $DIR/struct.rs:7:14
2018-08-08 07:28:26 -05:00
|
LL | let fr = FunctionalRecord {
| ______________^
2019-03-09 06:03:44 -06:00
LL | |
2018-08-08 07:28:26 -05:00
LL | | first_field: 1920,
LL | | second_field: 1080,
LL | | ..FunctionalRecord::default()
LL | | };
| |_____^
error[E0639]: cannot create non-exhaustive struct using struct expression
--> $DIR/struct.rs:14:14
2018-08-08 07:28:26 -05:00
|
LL | let ns = NormalStruct { first_field: 640, second_field: 480 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:17:9
2018-08-08 07:28:26 -05:00
|
LL | let NormalStruct { first_field, second_field } = ns;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:26:9
2018-08-08 07:28:26 -05:00
|
LL | let TupleStruct { 0: first_field, 1: second_field } = ts;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:35:9
2018-08-08 07:28:26 -05:00
|
LL | let UnitStruct { } = us;
| ^^^^^^^^^^^^^^
error: aborting due to 9 previous errors
Some errors have detailed explanations: E0423, E0603, E0638, E0639.
2018-08-08 07:28:26 -05:00
For more information about an error, try `rustc --explain E0423`.