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