]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/structs.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / structs.stderr
1 error[E0423]: expected function, found struct `TupleStruct`
2   --> $DIR/structs.rs:20:14
3    |
4 LL |     let ts = TupleStruct(640, 480);
5    |              ^^^^^^^^^^^ constructor is not visible here due to private fields
6
7 error[E0423]: expected value, found struct `UnitStruct`
8   --> $DIR/structs.rs:29:14
9    |
10 LL |     let us = UnitStruct;
11    |              ^^^^^^^^^^ constructor is not visible here due to private fields
12
13 error[E0603]: tuple struct `TupleStruct` is private
14   --> $DIR/structs.rs:23:32
15    |
16 LL |     let ts_explicit = structs::TupleStruct(640, 480);
17    |                                ^^^^^^^^^^^
18
19 error[E0603]: unit struct `UnitStruct` is private
20   --> $DIR/structs.rs:32:32
21    |
22 LL |     let us_explicit = structs::UnitStruct;
23    |                                ^^^^^^^^^^
24
25 error[E0639]: cannot create non-exhaustive struct using struct expression
26   --> $DIR/structs.rs:7:14
27    |
28 LL |       let fr = FunctionalRecord {
29    |  ______________^
30 LL | |     //~^ ERROR cannot create non-exhaustive struct
31 LL | |         first_field: 1920,
32 LL | |         second_field: 1080,
33 LL | |         ..FunctionalRecord::default()
34 LL | |     };
35    | |_____^
36
37 error[E0639]: cannot create non-exhaustive struct using struct expression
38   --> $DIR/structs.rs:14:14
39    |
40 LL |     let ns = NormalStruct { first_field: 640, second_field: 480 };
41    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43 error[E0638]: `..` required with struct marked as non-exhaustive
44   --> $DIR/structs.rs:17:9
45    |
46 LL |     let NormalStruct { first_field, second_field } = ns;
47    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
49 error[E0638]: `..` required with struct marked as non-exhaustive
50   --> $DIR/structs.rs:26:9
51    |
52 LL |     let TupleStruct { 0: first_field, 1: second_field } = ts;
53    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54
55 error[E0638]: `..` required with struct marked as non-exhaustive
56   --> $DIR/structs.rs:35:9
57    |
58 LL |     let UnitStruct { } = us;
59    |         ^^^^^^^^^^^^^^
60
61 error: aborting due to 9 previous errors
62
63 Some errors occurred: E0423, E0603, E0638, E0639.
64 For more information about an error, try `rustc --explain E0423`.