]>
Commit | Line | Data |
---|---|---|
e74abb32 | 1 | error[E0423]: expected function, tuple struct or tuple variant, found struct `TupleStruct` |
532ac7d7 | 2 | --> $DIR/struct.rs:20:14 |
b7449926 XL |
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` | |
532ac7d7 | 8 | --> $DIR/struct.rs:29:14 |
b7449926 XL |
9 | | |
10 | LL | let us = UnitStruct; | |
11 | | ^^^^^^^^^^ constructor is not visible here due to private fields | |
12 | ||
e74abb32 | 13 | error[E0603]: tuple struct constructor `TupleStruct` is private |
532ac7d7 | 14 | --> $DIR/struct.rs:23:32 |
b7449926 XL |
15 | | |
16 | LL | let ts_explicit = structs::TupleStruct(640, 480); | |
ba9703b0 | 17 | | ^^^^^^^^^^^ private tuple struct constructor |
e74abb32 XL |
18 | | |
19 | ::: $DIR/auxiliary/structs.rs:11:24 | |
416331ca | 20 | | |
e74abb32 XL |
21 | LL | pub struct TupleStruct(pub u16, pub u16); |
22 | | ---------------- a constructor is private if any of the fields is private | |
dfeec247 XL |
23 | | |
24 | note: the tuple struct constructor `TupleStruct` is defined here | |
25 | --> $DIR/auxiliary/structs.rs:11:1 | |
26 | | | |
27 | LL | pub struct TupleStruct(pub u16, pub u16); | |
28 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
b7449926 XL |
29 | |
30 | error[E0603]: unit struct `UnitStruct` is private | |
532ac7d7 | 31 | --> $DIR/struct.rs:32:32 |
b7449926 XL |
32 | | |
33 | LL | let us_explicit = structs::UnitStruct; | |
ba9703b0 | 34 | | ^^^^^^^^^^ private unit struct |
dfeec247 XL |
35 | | |
36 | note: the unit struct `UnitStruct` is defined here | |
37 | --> $DIR/auxiliary/structs.rs:8:1 | |
38 | | | |
39 | LL | pub struct UnitStruct; | |
40 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
b7449926 XL |
41 | |
42 | error[E0639]: cannot create non-exhaustive struct using struct expression | |
532ac7d7 | 43 | --> $DIR/struct.rs:7:14 |
b7449926 XL |
44 | | |
45 | LL | let fr = FunctionalRecord { | |
46 | | ______________^ | |
532ac7d7 | 47 | LL | | |
b7449926 XL |
48 | LL | | first_field: 1920, |
49 | LL | | second_field: 1080, | |
50 | LL | | ..FunctionalRecord::default() | |
51 | LL | | }; | |
52 | | |_____^ | |
53 | ||
54 | error[E0639]: cannot create non-exhaustive struct using struct expression | |
532ac7d7 | 55 | --> $DIR/struct.rs:14:14 |
b7449926 XL |
56 | | |
57 | LL | let ns = NormalStruct { first_field: 640, second_field: 480 }; | |
58 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
59 | ||
60 | error[E0638]: `..` required with struct marked as non-exhaustive | |
532ac7d7 | 61 | --> $DIR/struct.rs:17:9 |
b7449926 XL |
62 | | |
63 | LL | let NormalStruct { first_field, second_field } = ns; | |
64 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
ba9703b0 XL |
65 | | |
66 | help: add `..` at the end of the field list to ignore all other fields | |
67 | | | |
68 | LL | let NormalStruct { first_field, second_field , .. } = ns; | |
69 | | ^^^^^^ | |
b7449926 XL |
70 | |
71 | error[E0638]: `..` required with struct marked as non-exhaustive | |
532ac7d7 | 72 | --> $DIR/struct.rs:26:9 |
b7449926 XL |
73 | | |
74 | LL | let TupleStruct { 0: first_field, 1: second_field } = ts; | |
75 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
ba9703b0 XL |
76 | | |
77 | help: add `..` at the end of the field list to ignore all other fields | |
78 | | | |
79 | LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts; | |
80 | | ^^^^^^ | |
b7449926 XL |
81 | |
82 | error[E0638]: `..` required with struct marked as non-exhaustive | |
532ac7d7 | 83 | --> $DIR/struct.rs:35:9 |
b7449926 XL |
84 | | |
85 | LL | let UnitStruct { } = us; | |
86 | | ^^^^^^^^^^^^^^ | |
ba9703b0 XL |
87 | | |
88 | help: add `..` at the end of the field list to ignore all other fields | |
89 | | | |
90 | LL | let UnitStruct { .. } = us; | |
91 | | ^^^^ | |
b7449926 XL |
92 | |
93 | error: aborting due to 9 previous errors | |
94 | ||
48663c56 | 95 | Some errors have detailed explanations: E0423, E0603, E0638, E0639. |
b7449926 | 96 | For more information about an error, try `rustc --explain E0423`. |