]>
Commit | Line | Data |
---|---|---|
29967ef6 XL |
1 | error[E0423]: expected value, found enum `A` |
2 | --> $DIR/issue-73427.rs:29:5 | |
3 | | | |
4 | LL | A.foo(); | |
5 | | ^ | |
6 | | | |
7 | note: the enum is defined here | |
8 | --> $DIR/issue-73427.rs:1:1 | |
9 | | | |
10 | LL | / enum A { | |
11 | LL | | StructWithFields { x: () }, | |
12 | LL | | TupleWithFields(()), | |
13 | LL | | Struct {}, | |
14 | LL | | Tuple(), | |
15 | LL | | Unit, | |
16 | LL | | } | |
17 | | |_^ | |
18 | help: you might have meant to use one of the following enum variants | |
19 | | | |
20 | LL | (A::Struct {}).foo(); | |
21 | | ^^^^^^^^^^^^^^ | |
22 | LL | (A::Tuple()).foo(); | |
23 | | ^^^^^^^^^^^^ | |
24 | LL | A::Unit.foo(); | |
25 | | ^^^^^^^ | |
26 | help: the following enum variants are available | |
27 | | | |
28 | LL | (A::StructWithFields { /* fields */ }).foo(); | |
29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
30 | LL | (A::TupleWithFields(/* fields */)).foo(); | |
31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
32 | ||
33 | error[E0423]: expected value, found enum `B` | |
34 | --> $DIR/issue-73427.rs:31:5 | |
35 | | | |
36 | LL | B.foo(); | |
37 | | ^ | |
38 | | | |
39 | note: the enum is defined here | |
40 | --> $DIR/issue-73427.rs:9:1 | |
41 | | | |
42 | LL | / enum B { | |
43 | LL | | StructWithFields { x: () }, | |
44 | LL | | TupleWithFields(()), | |
45 | LL | | } | |
46 | | |_^ | |
47 | help: the following enum variants are available | |
48 | | | |
49 | LL | (B::StructWithFields { /* fields */ }).foo(); | |
50 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
51 | LL | (B::TupleWithFields(/* fields */)).foo(); | |
52 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
53 | ||
54 | error[E0423]: expected value, found enum `C` | |
55 | --> $DIR/issue-73427.rs:33:5 | |
56 | | | |
57 | LL | C.foo(); | |
58 | | ^ | |
59 | | | |
60 | note: the enum is defined here | |
61 | --> $DIR/issue-73427.rs:14:1 | |
62 | | | |
63 | LL | / enum C { | |
64 | LL | | StructWithFields { x: () }, | |
65 | LL | | TupleWithFields(()), | |
66 | LL | | Unit, | |
67 | LL | | } | |
68 | | |_^ | |
69 | help: you might have meant to use the following enum variant | |
70 | | | |
71 | LL | C::Unit.foo(); | |
72 | | ^^^^^^^ | |
73 | help: the following enum variants are available | |
74 | | | |
75 | LL | (C::StructWithFields { /* fields */ }).foo(); | |
76 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
77 | LL | (C::TupleWithFields(/* fields */)).foo(); | |
78 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
79 | ||
80 | error[E0423]: expected value, found enum `D` | |
81 | --> $DIR/issue-73427.rs:35:5 | |
82 | | | |
83 | LL | D.foo(); | |
84 | | ^ | |
85 | | | |
86 | note: the enum is defined here | |
87 | --> $DIR/issue-73427.rs:20:1 | |
88 | | | |
89 | LL | / enum D { | |
90 | LL | | TupleWithFields(()), | |
91 | LL | | Unit, | |
92 | LL | | } | |
93 | | |_^ | |
94 | help: you might have meant to use the following enum variant | |
95 | | | |
96 | LL | D::Unit.foo(); | |
97 | | ^^^^^^^ | |
98 | help: the following enum variant is available | |
99 | | | |
100 | LL | (D::TupleWithFields(/* fields */)).foo(); | |
101 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
102 | ||
103 | error[E0423]: expected function, tuple struct or tuple variant, found enum `A` | |
104 | --> $DIR/issue-73427.rs:40:13 | |
105 | | | |
106 | LL | let x = A(3); | |
107 | | ^ | |
108 | | | |
109 | = help: you might have meant to construct one of the enum's non-tuple variants | |
110 | note: the enum is defined here | |
111 | --> $DIR/issue-73427.rs:1:1 | |
112 | | | |
113 | LL | / enum A { | |
114 | LL | | StructWithFields { x: () }, | |
115 | LL | | TupleWithFields(()), | |
116 | LL | | Struct {}, | |
117 | LL | | Tuple(), | |
118 | LL | | Unit, | |
119 | LL | | } | |
120 | | |_^ | |
121 | help: try to construct one of the enum's variants | |
122 | | | |
123 | LL | let x = A::TupleWithFields(3); | |
124 | | ^^^^^^^^^^^^^^^^^^ | |
125 | LL | let x = A::Tuple(3); | |
126 | | ^^^^^^^^ | |
127 | ||
128 | error[E0532]: expected tuple struct or tuple variant, found enum `A` | |
129 | --> $DIR/issue-73427.rs:42:12 | |
130 | | | |
131 | LL | if let A(3) = x { } | |
132 | | ^ | |
133 | | | |
134 | = help: you might have meant to match against one of the enum's non-tuple variants | |
135 | note: the enum is defined here | |
136 | --> $DIR/issue-73427.rs:1:1 | |
137 | | | |
138 | LL | / enum A { | |
139 | LL | | StructWithFields { x: () }, | |
140 | LL | | TupleWithFields(()), | |
141 | LL | | Struct {}, | |
142 | LL | | Tuple(), | |
143 | LL | | Unit, | |
144 | LL | | } | |
145 | | |_^ | |
146 | help: try to match against one of the enum's variants | |
147 | | | |
148 | LL | if let A::TupleWithFields(3) = x { } | |
149 | | ^^^^^^^^^^^^^^^^^^ | |
150 | LL | if let A::Tuple(3) = x { } | |
151 | | ^^^^^^^^ | |
152 | ||
153 | error: aborting due to 6 previous errors | |
154 | ||
155 | Some errors have detailed explanations: E0423, E0532. | |
156 | For more information about an error, try `rustc --explain E0423`. |