]>
Commit | Line | Data |
---|---|---|
2c00a5a8 | 1 | error[E0423]: expected value, found enum `n::Z` |
0731742a | 2 | --> $DIR/privacy-enum-ctor.rs:23:9 |
2c00a5a8 | 3 | | |
0531ce1d | 4 | LL | n::Z; |
2c00a5a8 | 5 | | ^^^^ |
e74abb32 | 6 | | |
29967ef6 XL |
7 | note: the enum is defined here |
8 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
9 | | | |
10 | LL | / pub(in m) enum Z { | |
11 | LL | | Fn(u8), | |
12 | LL | | Struct { | |
13 | LL | | s: u8, | |
14 | LL | | }, | |
15 | LL | | Unit, | |
16 | LL | | } | |
17 | | |_________^ | |
18 | help: you might have meant to use the following enum variant | |
532ac7d7 | 19 | | |
532ac7d7 | 20 | LL | m::Z::Unit; |
94222f64 | 21 | | ~~~~~~~~~~ |
29967ef6 XL |
22 | help: the following enum variants are available |
23 | | | |
24 | LL | (m::Z::Fn(/* fields */)); | |
94222f64 | 25 | | ~~~~~~~~~~~~~~~~~~~~~~~~ |
29967ef6 | 26 | LL | (m::Z::Struct { /* fields */ }); |
94222f64 | 27 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2c00a5a8 XL |
28 | |
29 | error[E0423]: expected value, found enum `Z` | |
0731742a | 30 | --> $DIR/privacy-enum-ctor.rs:25:9 |
2c00a5a8 | 31 | | |
ba9703b0 XL |
32 | LL | Z; |
33 | | ^ | |
e74abb32 | 34 | | |
29967ef6 XL |
35 | note: the enum is defined here |
36 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
37 | | | |
38 | LL | / pub(in m) enum Z { | |
39 | LL | | Fn(u8), | |
40 | LL | | Struct { | |
41 | LL | | s: u8, | |
42 | LL | | }, | |
43 | LL | | Unit, | |
44 | LL | | } | |
45 | | |_________^ | |
46 | help: you might have meant to use the following enum variant | |
2c00a5a8 | 47 | | |
532ac7d7 | 48 | LL | m::Z::Unit; |
94222f64 | 49 | | ~~~~~~~~~~ |
29967ef6 XL |
50 | help: the following enum variants are available |
51 | | | |
52 | LL | (m::Z::Fn(/* fields */)); | |
94222f64 | 53 | | ~~~~~~~~~~~~~~~~~~~~~~~~ |
29967ef6 | 54 | LL | (m::Z::Struct { /* fields */ }); |
94222f64 | 55 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2c00a5a8 XL |
56 | |
57 | error[E0423]: expected value, found struct variant `Z::Struct` | |
0731742a | 58 | --> $DIR/privacy-enum-ctor.rs:29:20 |
2c00a5a8 | 59 | | |
e74abb32 XL |
60 | LL | / Struct { |
61 | LL | | s: u8, | |
62 | LL | | }, | |
63 | | |_____________- `Z::Struct` defined here | |
64 | ... | |
65 | LL | let _: Z = Z::Struct; | |
3dfed10e | 66 | | ^^^^^^^^^ help: use struct literal syntax instead: `Z::Struct { s: val }` |
2c00a5a8 XL |
67 | |
68 | error[E0423]: expected value, found enum `m::E` | |
0731742a | 69 | --> $DIR/privacy-enum-ctor.rs:41:16 |
2c00a5a8 | 70 | | |
ba9703b0 XL |
71 | LL | fn f() { |
72 | | ------ similarly named function `f` defined here | |
e74abb32 | 73 | ... |
ba9703b0 XL |
74 | LL | let _: E = m::E; |
75 | | ^^^^ | |
e74abb32 | 76 | | |
29967ef6 XL |
77 | note: the enum is defined here |
78 | --> $DIR/privacy-enum-ctor.rs:2:5 | |
79 | | | |
80 | LL | / pub enum E { | |
81 | LL | | Fn(u8), | |
82 | LL | | Struct { | |
83 | LL | | s: u8, | |
84 | LL | | }, | |
85 | LL | | Unit, | |
86 | LL | | } | |
87 | | |_____^ | |
88 | help: you might have meant to use the following enum variant | |
532ac7d7 | 89 | | |
532ac7d7 | 90 | LL | let _: E = E::Unit; |
94222f64 | 91 | | ~~~~~~~ |
29967ef6 XL |
92 | help: the following enum variants are available |
93 | | | |
94 | LL | let _: E = (E::Fn(/* fields */)); | |
94222f64 | 95 | | ~~~~~~~~~~~~~~~~~~~~~ |
29967ef6 | 96 | LL | let _: E = (E::Struct { /* fields */ }); |
94222f64 | 97 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
3dfed10e XL |
98 | help: a function with a similar name exists |
99 | | | |
100 | LL | let _: E = m::f; | |
94222f64 | 101 | | ~ |
f9f354fc | 102 | help: consider importing one of these items instead |
2c00a5a8 | 103 | | |
0531ce1d | 104 | LL | use std::f32::consts::E; |
2c00a5a8 | 105 | | |
0531ce1d | 106 | LL | use std::f64::consts::E; |
2c00a5a8 | 107 | | |
04454e1e FG |
108 | help: if you import `E`, refer to it directly |
109 | | | |
110 | LL - let _: E = m::E; | |
111 | LL + let _: E = E; | |
923072b8 | 112 | | |
2c00a5a8 XL |
113 | |
114 | error[E0423]: expected value, found struct variant `m::E::Struct` | |
0731742a | 115 | --> $DIR/privacy-enum-ctor.rs:45:16 |
2c00a5a8 | 116 | | |
e74abb32 XL |
117 | LL | / Struct { |
118 | LL | | s: u8, | |
119 | LL | | }, | |
120 | | |_________- `m::E::Struct` defined here | |
121 | ... | |
122 | LL | let _: E = m::E::Struct; | |
3dfed10e | 123 | | ^^^^^^^^^^^^ help: use struct literal syntax instead: `m::E::Struct { s: val }` |
2c00a5a8 XL |
124 | |
125 | error[E0423]: expected value, found enum `E` | |
0731742a | 126 | --> $DIR/privacy-enum-ctor.rs:49:16 |
2c00a5a8 | 127 | | |
0531ce1d | 128 | LL | let _: E = E; |
2c00a5a8 | 129 | | ^ |
e74abb32 | 130 | | |
29967ef6 XL |
131 | note: the enum is defined here |
132 | --> $DIR/privacy-enum-ctor.rs:2:5 | |
133 | | | |
134 | LL | / pub enum E { | |
135 | LL | | Fn(u8), | |
136 | LL | | Struct { | |
137 | LL | | s: u8, | |
138 | LL | | }, | |
139 | LL | | Unit, | |
140 | LL | | } | |
141 | | |_____^ | |
142 | help: you might have meant to use the following enum variant | |
2c00a5a8 | 143 | | |
532ac7d7 | 144 | LL | let _: E = E::Unit; |
94222f64 | 145 | | ~~~~~~~ |
29967ef6 XL |
146 | help: the following enum variants are available |
147 | | | |
148 | LL | let _: E = (E::Fn(/* fields */)); | |
94222f64 | 149 | | ~~~~~~~~~~~~~~~~~~~~~ |
29967ef6 | 150 | LL | let _: E = (E::Struct { /* fields */ }); |
94222f64 | 151 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
f9f354fc | 152 | help: consider importing one of these items instead |
2c00a5a8 | 153 | | |
0531ce1d | 154 | LL | use std::f32::consts::E; |
2c00a5a8 | 155 | | |
0531ce1d | 156 | LL | use std::f64::consts::E; |
2c00a5a8 XL |
157 | | |
158 | ||
159 | error[E0423]: expected value, found struct variant `E::Struct` | |
0731742a | 160 | --> $DIR/privacy-enum-ctor.rs:53:16 |
2c00a5a8 | 161 | | |
e74abb32 XL |
162 | LL | / Struct { |
163 | LL | | s: u8, | |
164 | LL | | }, | |
165 | | |_________- `E::Struct` defined here | |
166 | ... | |
167 | LL | let _: E = E::Struct; | |
3dfed10e | 168 | | ^^^^^^^^^ help: use struct literal syntax instead: `E::Struct { s: val }` |
2c00a5a8 XL |
169 | |
170 | error[E0412]: cannot find type `Z` in this scope | |
0731742a | 171 | --> $DIR/privacy-enum-ctor.rs:57:12 |
2c00a5a8 | 172 | | |
ba9703b0 XL |
173 | LL | pub enum E { |
174 | | ---------- similarly named enum `E` defined here | |
e74abb32 | 175 | ... |
ba9703b0 | 176 | LL | let _: Z = m::n::Z; |
c295e0f8 | 177 | | ^ help: an enum with a similar name exists: `E` |
e74abb32 | 178 | | |
c295e0f8 XL |
179 | note: enum `m::Z` exists but is inaccessible |
180 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
2c00a5a8 | 181 | | |
c295e0f8 XL |
182 | LL | pub(in m) enum Z { |
183 | | ^^^^^^^^^^^^^^^^ not accessible | |
2c00a5a8 XL |
184 | |
185 | error[E0423]: expected value, found enum `m::n::Z` | |
0731742a | 186 | --> $DIR/privacy-enum-ctor.rs:57:16 |
2c00a5a8 | 187 | | |
0531ce1d | 188 | LL | let _: Z = m::n::Z; |
2c00a5a8 | 189 | | ^^^^^^^ |
e74abb32 | 190 | | |
29967ef6 XL |
191 | note: the enum is defined here |
192 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
193 | | | |
194 | LL | / pub(in m) enum Z { | |
195 | LL | | Fn(u8), | |
196 | LL | | Struct { | |
197 | LL | | s: u8, | |
198 | LL | | }, | |
199 | LL | | Unit, | |
200 | LL | | } | |
201 | | |_________^ | |
202 | help: you might have meant to use the following enum variant | |
532ac7d7 | 203 | | |
532ac7d7 | 204 | LL | let _: Z = m::Z::Unit; |
94222f64 | 205 | | ~~~~~~~~~~ |
29967ef6 XL |
206 | help: the following enum variants are available |
207 | | | |
208 | LL | let _: Z = (m::Z::Fn(/* fields */)); | |
94222f64 | 209 | | ~~~~~~~~~~~~~~~~~~~~~~~~ |
29967ef6 | 210 | LL | let _: Z = (m::Z::Struct { /* fields */ }); |
94222f64 | 211 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2c00a5a8 XL |
212 | |
213 | error[E0412]: cannot find type `Z` in this scope | |
0731742a | 214 | --> $DIR/privacy-enum-ctor.rs:61:12 |
2c00a5a8 | 215 | | |
ba9703b0 XL |
216 | LL | pub enum E { |
217 | | ---------- similarly named enum `E` defined here | |
e74abb32 | 218 | ... |
ba9703b0 | 219 | LL | let _: Z = m::n::Z::Fn; |
c295e0f8 | 220 | | ^ help: an enum with a similar name exists: `E` |
e74abb32 | 221 | | |
c295e0f8 XL |
222 | note: enum `m::Z` exists but is inaccessible |
223 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
2c00a5a8 | 224 | | |
c295e0f8 XL |
225 | LL | pub(in m) enum Z { |
226 | | ^^^^^^^^^^^^^^^^ not accessible | |
2c00a5a8 XL |
227 | |
228 | error[E0412]: cannot find type `Z` in this scope | |
0731742a | 229 | --> $DIR/privacy-enum-ctor.rs:64:12 |
2c00a5a8 | 230 | | |
ba9703b0 XL |
231 | LL | pub enum E { |
232 | | ---------- similarly named enum `E` defined here | |
e74abb32 | 233 | ... |
ba9703b0 | 234 | LL | let _: Z = m::n::Z::Struct; |
c295e0f8 | 235 | | ^ help: an enum with a similar name exists: `E` |
e74abb32 | 236 | | |
c295e0f8 XL |
237 | note: enum `m::Z` exists but is inaccessible |
238 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
2c00a5a8 | 239 | | |
c295e0f8 XL |
240 | LL | pub(in m) enum Z { |
241 | | ^^^^^^^^^^^^^^^^ not accessible | |
2c00a5a8 XL |
242 | |
243 | error[E0423]: expected value, found struct variant `m::n::Z::Struct` | |
0731742a | 244 | --> $DIR/privacy-enum-ctor.rs:64:16 |
2c00a5a8 | 245 | | |
e74abb32 XL |
246 | LL | / Struct { |
247 | LL | | s: u8, | |
248 | LL | | }, | |
249 | | |_____________- `m::n::Z::Struct` defined here | |
250 | ... | |
251 | LL | let _: Z = m::n::Z::Struct; | |
3dfed10e | 252 | | ^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `m::n::Z::Struct { s: val }` |
2c00a5a8 XL |
253 | |
254 | error[E0412]: cannot find type `Z` in this scope | |
0731742a | 255 | --> $DIR/privacy-enum-ctor.rs:68:12 |
2c00a5a8 | 256 | | |
ba9703b0 XL |
257 | LL | pub enum E { |
258 | | ---------- similarly named enum `E` defined here | |
e74abb32 | 259 | ... |
ba9703b0 | 260 | LL | let _: Z = m::n::Z::Unit {}; |
c295e0f8 | 261 | | ^ help: an enum with a similar name exists: `E` |
e74abb32 | 262 | | |
c295e0f8 XL |
263 | note: enum `m::Z` exists but is inaccessible |
264 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
2c00a5a8 | 265 | | |
c295e0f8 XL |
266 | LL | pub(in m) enum Z { |
267 | | ^^^^^^^^^^^^^^^^ not accessible | |
2c00a5a8 XL |
268 | |
269 | error[E0603]: enum `Z` is private | |
0731742a | 270 | --> $DIR/privacy-enum-ctor.rs:57:22 |
2c00a5a8 | 271 | | |
0531ce1d | 272 | LL | let _: Z = m::n::Z; |
ba9703b0 | 273 | | ^ private enum |
dfeec247 XL |
274 | | |
275 | note: the enum `Z` is defined here | |
276 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
277 | | | |
278 | LL | pub(in m) enum Z { | |
279 | | ^^^^^^^^^^^^^^^^ | |
2c00a5a8 XL |
280 | |
281 | error[E0603]: enum `Z` is private | |
0731742a | 282 | --> $DIR/privacy-enum-ctor.rs:61:22 |
2c00a5a8 | 283 | | |
0531ce1d | 284 | LL | let _: Z = m::n::Z::Fn; |
ba9703b0 | 285 | | ^ private enum |
dfeec247 XL |
286 | | |
287 | note: the enum `Z` is defined here | |
288 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
289 | | | |
290 | LL | pub(in m) enum Z { | |
291 | | ^^^^^^^^^^^^^^^^ | |
2c00a5a8 XL |
292 | |
293 | error[E0603]: enum `Z` is private | |
0731742a | 294 | --> $DIR/privacy-enum-ctor.rs:64:22 |
2c00a5a8 | 295 | | |
0531ce1d | 296 | LL | let _: Z = m::n::Z::Struct; |
ba9703b0 | 297 | | ^ private enum |
dfeec247 XL |
298 | | |
299 | note: the enum `Z` is defined here | |
300 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
301 | | | |
302 | LL | pub(in m) enum Z { | |
303 | | ^^^^^^^^^^^^^^^^ | |
2c00a5a8 XL |
304 | |
305 | error[E0603]: enum `Z` is private | |
0731742a | 306 | --> $DIR/privacy-enum-ctor.rs:68:22 |
2c00a5a8 | 307 | | |
0531ce1d | 308 | LL | let _: Z = m::n::Z::Unit {}; |
ba9703b0 | 309 | | ^ private enum |
dfeec247 XL |
310 | | |
311 | note: the enum `Z` is defined here | |
312 | --> $DIR/privacy-enum-ctor.rs:11:9 | |
313 | | | |
314 | LL | pub(in m) enum Z { | |
315 | | ^^^^^^^^^^^^^^^^ | |
2c00a5a8 XL |
316 | |
317 | error[E0308]: mismatched types | |
0731742a | 318 | --> $DIR/privacy-enum-ctor.rs:27:20 |
2c00a5a8 | 319 | | |
416331ca | 320 | LL | Fn(u8), |
1b1a35ee | 321 | | ------ fn(u8) -> Z {Z::Fn} defined here |
416331ca | 322 | ... |
0531ce1d | 323 | LL | let _: Z = Z::Fn; |
1b1a35ee | 324 | | - ^^^^^ expected enum `Z`, found fn item |
ba9703b0 | 325 | | | |
60c5eb7d XL |
326 | | expected due to this |
327 | | | |
1b1a35ee XL |
328 | = note: expected enum `Z` |
329 | found fn item `fn(u8) -> Z {Z::Fn}` | |
ba9703b0 XL |
330 | help: use parentheses to instantiate this tuple variant |
331 | | | |
332 | LL | let _: Z = Z::Fn(_); | |
94222f64 | 333 | | +++ |
2c00a5a8 XL |
334 | |
335 | error[E0618]: expected function, found enum variant `Z::Unit` | |
0731742a | 336 | --> $DIR/privacy-enum-ctor.rs:31:17 |
2c00a5a8 | 337 | | |
0531ce1d | 338 | LL | Unit, |
2c00a5a8 XL |
339 | | ---- `Z::Unit` defined here |
340 | ... | |
0531ce1d | 341 | LL | let _ = Z::Unit(); |
a1dfa0c6 XL |
342 | | ^^^^^^^-- |
343 | | | | |
344 | | call expression requires function | |
e74abb32 | 345 | | |
3c0e092e | 346 | help: `Z::Unit` is a unit variant, you need to write it without the parentheses |
2c00a5a8 | 347 | | |
3c0e092e XL |
348 | LL - let _ = Z::Unit(); |
349 | LL + let _ = Z::Unit; | |
923072b8 | 350 | | |
2c00a5a8 XL |
351 | |
352 | error[E0308]: mismatched types | |
0731742a | 353 | --> $DIR/privacy-enum-ctor.rs:43:16 |
2c00a5a8 | 354 | | |
416331ca | 355 | LL | Fn(u8), |
1b1a35ee | 356 | | ------ fn(u8) -> E {E::Fn} defined here |
416331ca | 357 | ... |
0531ce1d | 358 | LL | let _: E = m::E::Fn; |
1b1a35ee | 359 | | - ^^^^^^^^ expected enum `E`, found fn item |
ba9703b0 | 360 | | | |
60c5eb7d XL |
361 | | expected due to this |
362 | | | |
1b1a35ee XL |
363 | = note: expected enum `E` |
364 | found fn item `fn(u8) -> E {E::Fn}` | |
ba9703b0 XL |
365 | help: use parentheses to instantiate this tuple variant |
366 | | | |
367 | LL | let _: E = m::E::Fn(_); | |
94222f64 | 368 | | +++ |
2c00a5a8 XL |
369 | |
370 | error[E0618]: expected function, found enum variant `m::E::Unit` | |
0731742a | 371 | --> $DIR/privacy-enum-ctor.rs:47:16 |
2c00a5a8 | 372 | | |
0531ce1d | 373 | LL | Unit, |
2c00a5a8 XL |
374 | | ---- `m::E::Unit` defined here |
375 | ... | |
0531ce1d | 376 | LL | let _: E = m::E::Unit(); |
a1dfa0c6 XL |
377 | | ^^^^^^^^^^-- |
378 | | | | |
379 | | call expression requires function | |
e74abb32 | 380 | | |
3c0e092e | 381 | help: `m::E::Unit` is a unit variant, you need to write it without the parentheses |
2c00a5a8 | 382 | | |
3c0e092e XL |
383 | LL - let _: E = m::E::Unit(); |
384 | LL + let _: E = m::E::Unit; | |
923072b8 | 385 | | |
2c00a5a8 XL |
386 | |
387 | error[E0308]: mismatched types | |
0731742a | 388 | --> $DIR/privacy-enum-ctor.rs:51:16 |
2c00a5a8 | 389 | | |
416331ca | 390 | LL | Fn(u8), |
1b1a35ee | 391 | | ------ fn(u8) -> E {E::Fn} defined here |
416331ca | 392 | ... |
0531ce1d | 393 | LL | let _: E = E::Fn; |
1b1a35ee | 394 | | - ^^^^^ expected enum `E`, found fn item |
ba9703b0 | 395 | | | |
60c5eb7d XL |
396 | | expected due to this |
397 | | | |
1b1a35ee XL |
398 | = note: expected enum `E` |
399 | found fn item `fn(u8) -> E {E::Fn}` | |
ba9703b0 XL |
400 | help: use parentheses to instantiate this tuple variant |
401 | | | |
402 | LL | let _: E = E::Fn(_); | |
94222f64 | 403 | | +++ |
2c00a5a8 XL |
404 | |
405 | error[E0618]: expected function, found enum variant `E::Unit` | |
0731742a | 406 | --> $DIR/privacy-enum-ctor.rs:55:16 |
2c00a5a8 | 407 | | |
0531ce1d | 408 | LL | Unit, |
2c00a5a8 XL |
409 | | ---- `E::Unit` defined here |
410 | ... | |
0531ce1d | 411 | LL | let _: E = E::Unit(); |
a1dfa0c6 XL |
412 | | ^^^^^^^-- |
413 | | | | |
414 | | call expression requires function | |
e74abb32 | 415 | | |
3c0e092e | 416 | help: `E::Unit` is a unit variant, you need to write it without the parentheses |
2c00a5a8 | 417 | | |
3c0e092e XL |
418 | LL - let _: E = E::Unit(); |
419 | LL + let _: E = E::Unit; | |
923072b8 | 420 | | |
2c00a5a8 XL |
421 | |
422 | error: aborting due to 23 previous errors | |
423 | ||
48663c56 | 424 | Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618. |
0531ce1d | 425 | For more information about an error, try `rustc --explain E0308`. |