]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/privacy-enum-ctor.stderr
e546d9f64ecad27d2b0a46f92e8643fc9639d37d
[rust.git] / src / test / ui / resolve / privacy-enum-ctor.stderr
1 error[E0423]: expected value, found enum `n::Z`
2   --> $DIR/privacy-enum-ctor.rs:23:9
3    |
4 LL |         n::Z;
5    |         ^^^^
6    |
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
19    |
20 LL |         m::Z::Unit;
21    |         ~~~~~~~~~~
22 help: the following enum variants are available
23    |
24 LL |         (m::Z::Fn(/* fields */));
25    |         ~~~~~~~~~~~~~~~~~~~~~~~~
26 LL |         (m::Z::Struct { /* fields */ });
27    |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28
29 error[E0423]: expected value, found enum `Z`
30   --> $DIR/privacy-enum-ctor.rs:25:9
31    |
32 LL |         Z;
33    |         ^
34    |
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
47    |
48 LL |         m::Z::Unit;
49    |         ~~~~~~~~~~
50 help: the following enum variants are available
51    |
52 LL |         (m::Z::Fn(/* fields */));
53    |         ~~~~~~~~~~~~~~~~~~~~~~~~
54 LL |         (m::Z::Struct { /* fields */ });
55    |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56
57 error[E0423]: expected value, found struct variant `Z::Struct`
58   --> $DIR/privacy-enum-ctor.rs:29:20
59    |
60 LL | /             Struct {
61 LL | |                 s: u8,
62 LL | |             },
63    | |_____________- `Z::Struct` defined here
64 ...
65 LL |           let _: Z = Z::Struct;
66    |                      ^^^^^^^^^ help: use struct literal syntax instead: `Z::Struct { s: val }`
67
68 error[E0423]: expected value, found enum `m::E`
69   --> $DIR/privacy-enum-ctor.rs:41:16
70    |
71 LL |     fn f() {
72    |     ------ similarly named function `f` defined here
73 ...
74 LL |     let _: E = m::E;
75    |                ^^^^
76    |
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
89    |
90 LL |     let _: E = E::Unit;
91    |                ~~~~~~~
92 help: the following enum variants are available
93    |
94 LL |     let _: E = (E::Fn(/* fields */));
95    |                ~~~~~~~~~~~~~~~~~~~~~
96 LL |     let _: E = (E::Struct { /* fields */ });
97    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98 help: a function with a similar name exists
99    |
100 LL |     let _: E = m::f;
101    |                   ~
102 help: consider importing one of these items instead
103    |
104 LL | use std::f32::consts::E;
105    |
106 LL | use std::f64::consts::E;
107    |
108 help: if you import `E`, refer to it directly
109    |
110 LL -     let _: E = m::E;
111 LL +     let _: E = E;
112    |
113
114 error[E0423]: expected value, found struct variant `m::E::Struct`
115   --> $DIR/privacy-enum-ctor.rs:45:16
116    |
117 LL | /         Struct {
118 LL | |             s: u8,
119 LL | |         },
120    | |_________- `m::E::Struct` defined here
121 ...
122 LL |       let _: E = m::E::Struct;
123    |                  ^^^^^^^^^^^^ help: use struct literal syntax instead: `m::E::Struct { s: val }`
124
125 error[E0423]: expected value, found enum `E`
126   --> $DIR/privacy-enum-ctor.rs:49:16
127    |
128 LL |     let _: E = E;
129    |                ^
130    |
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
143    |
144 LL |     let _: E = E::Unit;
145    |                ~~~~~~~
146 help: the following enum variants are available
147    |
148 LL |     let _: E = (E::Fn(/* fields */));
149    |                ~~~~~~~~~~~~~~~~~~~~~
150 LL |     let _: E = (E::Struct { /* fields */ });
151    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152 help: consider importing one of these items instead
153    |
154 LL | use std::f32::consts::E;
155    |
156 LL | use std::f64::consts::E;
157    |
158
159 error[E0423]: expected value, found struct variant `E::Struct`
160   --> $DIR/privacy-enum-ctor.rs:53:16
161    |
162 LL | /         Struct {
163 LL | |             s: u8,
164 LL | |         },
165    | |_________- `E::Struct` defined here
166 ...
167 LL |       let _: E = E::Struct;
168    |                  ^^^^^^^^^ help: use struct literal syntax instead: `E::Struct { s: val }`
169
170 error[E0412]: cannot find type `Z` in this scope
171   --> $DIR/privacy-enum-ctor.rs:57:12
172    |
173 LL |     pub enum E {
174    |     ---------- similarly named enum `E` defined here
175 ...
176 LL |     let _: Z = m::n::Z;
177    |            ^ help: an enum with a similar name exists: `E`
178    |
179 note: enum `m::Z` exists but is inaccessible
180   --> $DIR/privacy-enum-ctor.rs:11:9
181    |
182 LL |         pub(in m) enum Z {
183    |         ^^^^^^^^^^^^^^^^ not accessible
184
185 error[E0423]: expected value, found enum `m::n::Z`
186   --> $DIR/privacy-enum-ctor.rs:57:16
187    |
188 LL |     let _: Z = m::n::Z;
189    |                ^^^^^^^
190    |
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
203    |
204 LL |     let _: Z = m::Z::Unit;
205    |                ~~~~~~~~~~
206 help: the following enum variants are available
207    |
208 LL |     let _: Z = (m::Z::Fn(/* fields */));
209    |                ~~~~~~~~~~~~~~~~~~~~~~~~
210 LL |     let _: Z = (m::Z::Struct { /* fields */ });
211    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212
213 error[E0412]: cannot find type `Z` in this scope
214   --> $DIR/privacy-enum-ctor.rs:61:12
215    |
216 LL |     pub enum E {
217    |     ---------- similarly named enum `E` defined here
218 ...
219 LL |     let _: Z = m::n::Z::Fn;
220    |            ^ help: an enum with a similar name exists: `E`
221    |
222 note: enum `m::Z` exists but is inaccessible
223   --> $DIR/privacy-enum-ctor.rs:11:9
224    |
225 LL |         pub(in m) enum Z {
226    |         ^^^^^^^^^^^^^^^^ not accessible
227
228 error[E0412]: cannot find type `Z` in this scope
229   --> $DIR/privacy-enum-ctor.rs:64:12
230    |
231 LL |     pub enum E {
232    |     ---------- similarly named enum `E` defined here
233 ...
234 LL |     let _: Z = m::n::Z::Struct;
235    |            ^ help: an enum with a similar name exists: `E`
236    |
237 note: enum `m::Z` exists but is inaccessible
238   --> $DIR/privacy-enum-ctor.rs:11:9
239    |
240 LL |         pub(in m) enum Z {
241    |         ^^^^^^^^^^^^^^^^ not accessible
242
243 error[E0423]: expected value, found struct variant `m::n::Z::Struct`
244   --> $DIR/privacy-enum-ctor.rs:64:16
245    |
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;
252    |                  ^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `m::n::Z::Struct { s: val }`
253
254 error[E0412]: cannot find type `Z` in this scope
255   --> $DIR/privacy-enum-ctor.rs:68:12
256    |
257 LL |     pub enum E {
258    |     ---------- similarly named enum `E` defined here
259 ...
260 LL |     let _: Z = m::n::Z::Unit {};
261    |            ^ help: an enum with a similar name exists: `E`
262    |
263 note: enum `m::Z` exists but is inaccessible
264   --> $DIR/privacy-enum-ctor.rs:11:9
265    |
266 LL |         pub(in m) enum Z {
267    |         ^^^^^^^^^^^^^^^^ not accessible
268
269 error[E0603]: enum `Z` is private
270   --> $DIR/privacy-enum-ctor.rs:57:22
271    |
272 LL |     let _: Z = m::n::Z;
273    |                      ^ private enum
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    |         ^^^^^^^^^^^^^^^^
280
281 error[E0603]: enum `Z` is private
282   --> $DIR/privacy-enum-ctor.rs:61:22
283    |
284 LL |     let _: Z = m::n::Z::Fn;
285    |                      ^ private enum
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    |         ^^^^^^^^^^^^^^^^
292
293 error[E0603]: enum `Z` is private
294   --> $DIR/privacy-enum-ctor.rs:64:22
295    |
296 LL |     let _: Z = m::n::Z::Struct;
297    |                      ^ private enum
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    |         ^^^^^^^^^^^^^^^^
304
305 error[E0603]: enum `Z` is private
306   --> $DIR/privacy-enum-ctor.rs:68:22
307    |
308 LL |     let _: Z = m::n::Z::Unit {};
309    |                      ^ private enum
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    |         ^^^^^^^^^^^^^^^^
316
317 error[E0308]: mismatched types
318   --> $DIR/privacy-enum-ctor.rs:27:20
319    |
320 LL |             Fn(u8),
321    |             -- fn(u8) -> Z {Z::Fn} defined here
322 ...
323 LL |         let _: Z = Z::Fn;
324    |                -   ^^^^^ expected enum `Z`, found fn item
325    |                |
326    |                expected due to this
327    |
328    = note: expected enum `Z`
329            found fn item `fn(u8) -> Z {Z::Fn}`
330 help: use parentheses to instantiate this tuple variant
331    |
332 LL |         let _: Z = Z::Fn(_);
333    |                         +++
334
335 error[E0618]: expected function, found enum variant `Z::Unit`
336   --> $DIR/privacy-enum-ctor.rs:31:17
337    |
338 LL |             Unit,
339    |             ---- `Z::Unit` defined here
340 ...
341 LL |         let _ = Z::Unit();
342    |                 ^^^^^^^--
343    |                 |
344    |                 call expression requires function
345    |
346 help: `Z::Unit` is a unit variant, you need to write it without the parentheses
347    |
348 LL -         let _ = Z::Unit();
349 LL +         let _ = Z::Unit;
350    |
351
352 error[E0308]: mismatched types
353   --> $DIR/privacy-enum-ctor.rs:43:16
354    |
355 LL |         Fn(u8),
356    |         -- fn(u8) -> E {E::Fn} defined here
357 ...
358 LL |     let _: E = m::E::Fn;
359    |            -   ^^^^^^^^ expected enum `E`, found fn item
360    |            |
361    |            expected due to this
362    |
363    = note: expected enum `E`
364            found fn item `fn(u8) -> E {E::Fn}`
365 help: use parentheses to instantiate this tuple variant
366    |
367 LL |     let _: E = m::E::Fn(_);
368    |                        +++
369
370 error[E0618]: expected function, found enum variant `m::E::Unit`
371   --> $DIR/privacy-enum-ctor.rs:47:16
372    |
373 LL |         Unit,
374    |         ---- `m::E::Unit` defined here
375 ...
376 LL |     let _: E = m::E::Unit();
377    |                ^^^^^^^^^^--
378    |                |
379    |                call expression requires function
380    |
381 help: `m::E::Unit` is a unit variant, you need to write it without the parentheses
382    |
383 LL -     let _: E = m::E::Unit();
384 LL +     let _: E = m::E::Unit;
385    |
386
387 error[E0308]: mismatched types
388   --> $DIR/privacy-enum-ctor.rs:51:16
389    |
390 LL |         Fn(u8),
391    |         -- fn(u8) -> E {E::Fn} defined here
392 ...
393 LL |     let _: E = E::Fn;
394    |            -   ^^^^^ expected enum `E`, found fn item
395    |            |
396    |            expected due to this
397    |
398    = note: expected enum `E`
399            found fn item `fn(u8) -> E {E::Fn}`
400 help: use parentheses to instantiate this tuple variant
401    |
402 LL |     let _: E = E::Fn(_);
403    |                     +++
404
405 error[E0618]: expected function, found enum variant `E::Unit`
406   --> $DIR/privacy-enum-ctor.rs:55:16
407    |
408 LL |         Unit,
409    |         ---- `E::Unit` defined here
410 ...
411 LL |     let _: E = E::Unit();
412    |                ^^^^^^^--
413    |                |
414    |                call expression requires function
415    |
416 help: `E::Unit` is a unit variant, you need to write it without the parentheses
417    |
418 LL -     let _: E = E::Unit();
419 LL +     let _: E = E::Unit;
420    |
421
422 error: aborting due to 23 previous errors
423
424 Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618.
425 For more information about an error, try `rustc --explain E0308`.