]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/privacy-enum-ctor.stderr
Sync rust-lang/portable-simd@03f6fbb21e6050da2a05b3ce8f480c020b384916
[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
109 error[E0423]: expected value, found struct variant `m::E::Struct`
110   --> $DIR/privacy-enum-ctor.rs:45:16
111    |
112 LL | /         Struct {
113 LL | |             s: u8,
114 LL | |         },
115    | |_________- `m::E::Struct` defined here
116 ...
117 LL |       let _: E = m::E::Struct;
118    |                  ^^^^^^^^^^^^ help: use struct literal syntax instead: `m::E::Struct { s: val }`
119
120 error[E0423]: expected value, found enum `E`
121   --> $DIR/privacy-enum-ctor.rs:49:16
122    |
123 LL |     let _: E = E;
124    |                ^
125    |
126 note: the enum is defined here
127   --> $DIR/privacy-enum-ctor.rs:2:5
128    |
129 LL | /     pub enum E {
130 LL | |         Fn(u8),
131 LL | |         Struct {
132 LL | |             s: u8,
133 LL | |         },
134 LL | |         Unit,
135 LL | |     }
136    | |_____^
137 help: you might have meant to use the following enum variant
138    |
139 LL |     let _: E = E::Unit;
140    |                ~~~~~~~
141 help: the following enum variants are available
142    |
143 LL |     let _: E = (E::Fn(/* fields */));
144    |                ~~~~~~~~~~~~~~~~~~~~~
145 LL |     let _: E = (E::Struct { /* fields */ });
146    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147 help: consider importing one of these items instead
148    |
149 LL | use std::f32::consts::E;
150    |
151 LL | use std::f64::consts::E;
152    |
153
154 error[E0423]: expected value, found struct variant `E::Struct`
155   --> $DIR/privacy-enum-ctor.rs:53:16
156    |
157 LL | /         Struct {
158 LL | |             s: u8,
159 LL | |         },
160    | |_________- `E::Struct` defined here
161 ...
162 LL |       let _: E = E::Struct;
163    |                  ^^^^^^^^^ help: use struct literal syntax instead: `E::Struct { s: val }`
164
165 error[E0412]: cannot find type `Z` in this scope
166   --> $DIR/privacy-enum-ctor.rs:57:12
167    |
168 LL |     pub enum E {
169    |     ---------- similarly named enum `E` defined here
170 ...
171 LL |     let _: Z = m::n::Z;
172    |            ^ help: an enum with a similar name exists: `E`
173    |
174 note: enum `m::Z` exists but is inaccessible
175   --> $DIR/privacy-enum-ctor.rs:11:9
176    |
177 LL |         pub(in m) enum Z {
178    |         ^^^^^^^^^^^^^^^^ not accessible
179
180 error[E0423]: expected value, found enum `m::n::Z`
181   --> $DIR/privacy-enum-ctor.rs:57:16
182    |
183 LL |     let _: Z = m::n::Z;
184    |                ^^^^^^^
185    |
186 note: the enum is defined here
187   --> $DIR/privacy-enum-ctor.rs:11:9
188    |
189 LL | /         pub(in m) enum Z {
190 LL | |             Fn(u8),
191 LL | |             Struct {
192 LL | |                 s: u8,
193 LL | |             },
194 LL | |             Unit,
195 LL | |         }
196    | |_________^
197 help: you might have meant to use the following enum variant
198    |
199 LL |     let _: Z = m::Z::Unit;
200    |                ~~~~~~~~~~
201 help: the following enum variants are available
202    |
203 LL |     let _: Z = (m::Z::Fn(/* fields */));
204    |                ~~~~~~~~~~~~~~~~~~~~~~~~
205 LL |     let _: Z = (m::Z::Struct { /* fields */ });
206    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207
208 error[E0412]: cannot find type `Z` in this scope
209   --> $DIR/privacy-enum-ctor.rs:61:12
210    |
211 LL |     pub enum E {
212    |     ---------- similarly named enum `E` defined here
213 ...
214 LL |     let _: Z = m::n::Z::Fn;
215    |            ^ help: an enum with a similar name exists: `E`
216    |
217 note: enum `m::Z` exists but is inaccessible
218   --> $DIR/privacy-enum-ctor.rs:11:9
219    |
220 LL |         pub(in m) enum Z {
221    |         ^^^^^^^^^^^^^^^^ not accessible
222
223 error[E0412]: cannot find type `Z` in this scope
224   --> $DIR/privacy-enum-ctor.rs:64:12
225    |
226 LL |     pub enum E {
227    |     ---------- similarly named enum `E` defined here
228 ...
229 LL |     let _: Z = m::n::Z::Struct;
230    |            ^ help: an enum with a similar name exists: `E`
231    |
232 note: enum `m::Z` exists but is inaccessible
233   --> $DIR/privacy-enum-ctor.rs:11:9
234    |
235 LL |         pub(in m) enum Z {
236    |         ^^^^^^^^^^^^^^^^ not accessible
237
238 error[E0423]: expected value, found struct variant `m::n::Z::Struct`
239   --> $DIR/privacy-enum-ctor.rs:64:16
240    |
241 LL | /             Struct {
242 LL | |                 s: u8,
243 LL | |             },
244    | |_____________- `m::n::Z::Struct` defined here
245 ...
246 LL |       let _: Z = m::n::Z::Struct;
247    |                  ^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `m::n::Z::Struct { s: val }`
248
249 error[E0412]: cannot find type `Z` in this scope
250   --> $DIR/privacy-enum-ctor.rs:68:12
251    |
252 LL |     pub enum E {
253    |     ---------- similarly named enum `E` defined here
254 ...
255 LL |     let _: Z = m::n::Z::Unit {};
256    |            ^ help: an enum with a similar name exists: `E`
257    |
258 note: enum `m::Z` exists but is inaccessible
259   --> $DIR/privacy-enum-ctor.rs:11:9
260    |
261 LL |         pub(in m) enum Z {
262    |         ^^^^^^^^^^^^^^^^ not accessible
263
264 error[E0603]: enum `Z` is private
265   --> $DIR/privacy-enum-ctor.rs:57:22
266    |
267 LL |     let _: Z = m::n::Z;
268    |                      ^ private enum
269    |
270 note: the enum `Z` is defined here
271   --> $DIR/privacy-enum-ctor.rs:11:9
272    |
273 LL |         pub(in m) enum Z {
274    |         ^^^^^^^^^^^^^^^^
275
276 error[E0603]: enum `Z` is private
277   --> $DIR/privacy-enum-ctor.rs:61:22
278    |
279 LL |     let _: Z = m::n::Z::Fn;
280    |                      ^ private enum
281    |
282 note: the enum `Z` is defined here
283   --> $DIR/privacy-enum-ctor.rs:11:9
284    |
285 LL |         pub(in m) enum Z {
286    |         ^^^^^^^^^^^^^^^^
287
288 error[E0603]: enum `Z` is private
289   --> $DIR/privacy-enum-ctor.rs:64:22
290    |
291 LL |     let _: Z = m::n::Z::Struct;
292    |                      ^ private enum
293    |
294 note: the enum `Z` is defined here
295   --> $DIR/privacy-enum-ctor.rs:11:9
296    |
297 LL |         pub(in m) enum Z {
298    |         ^^^^^^^^^^^^^^^^
299
300 error[E0603]: enum `Z` is private
301   --> $DIR/privacy-enum-ctor.rs:68:22
302    |
303 LL |     let _: Z = m::n::Z::Unit {};
304    |                      ^ private enum
305    |
306 note: the enum `Z` is defined here
307   --> $DIR/privacy-enum-ctor.rs:11:9
308    |
309 LL |         pub(in m) enum Z {
310    |         ^^^^^^^^^^^^^^^^
311
312 error[E0308]: mismatched types
313   --> $DIR/privacy-enum-ctor.rs:27:20
314    |
315 LL |             Fn(u8),
316    |             ------ fn(u8) -> Z {Z::Fn} defined here
317 ...
318 LL |         let _: Z = Z::Fn;
319    |                -   ^^^^^ expected enum `Z`, found fn item
320    |                |
321    |                expected due to this
322    |
323    = note: expected enum `Z`
324            found fn item `fn(u8) -> Z {Z::Fn}`
325 help: use parentheses to instantiate this tuple variant
326    |
327 LL |         let _: Z = Z::Fn(_);
328    |                         +++
329
330 error[E0618]: expected function, found enum variant `Z::Unit`
331   --> $DIR/privacy-enum-ctor.rs:31:17
332    |
333 LL |             Unit,
334    |             ---- `Z::Unit` defined here
335 ...
336 LL |         let _ = Z::Unit();
337    |                 ^^^^^^^--
338    |                 |
339    |                 call expression requires function
340    |
341 help: `Z::Unit` is a unit variant, you need to write it without the parentheses
342    |
343 LL -         let _ = Z::Unit();
344 LL +         let _ = Z::Unit;
345    | 
346
347 error[E0308]: mismatched types
348   --> $DIR/privacy-enum-ctor.rs:43:16
349    |
350 LL |         Fn(u8),
351    |         ------ fn(u8) -> E {E::Fn} defined here
352 ...
353 LL |     let _: E = m::E::Fn;
354    |            -   ^^^^^^^^ expected enum `E`, found fn item
355    |            |
356    |            expected due to this
357    |
358    = note: expected enum `E`
359            found fn item `fn(u8) -> E {E::Fn}`
360 help: use parentheses to instantiate this tuple variant
361    |
362 LL |     let _: E = m::E::Fn(_);
363    |                        +++
364
365 error[E0618]: expected function, found enum variant `m::E::Unit`
366   --> $DIR/privacy-enum-ctor.rs:47:16
367    |
368 LL |         Unit,
369    |         ---- `m::E::Unit` defined here
370 ...
371 LL |     let _: E = m::E::Unit();
372    |                ^^^^^^^^^^--
373    |                |
374    |                call expression requires function
375    |
376 help: `m::E::Unit` is a unit variant, you need to write it without the parentheses
377    |
378 LL -     let _: E = m::E::Unit();
379 LL +     let _: E = m::E::Unit;
380    | 
381
382 error[E0308]: mismatched types
383   --> $DIR/privacy-enum-ctor.rs:51:16
384    |
385 LL |         Fn(u8),
386    |         ------ fn(u8) -> E {E::Fn} defined here
387 ...
388 LL |     let _: E = E::Fn;
389    |            -   ^^^^^ expected enum `E`, found fn item
390    |            |
391    |            expected due to this
392    |
393    = note: expected enum `E`
394            found fn item `fn(u8) -> E {E::Fn}`
395 help: use parentheses to instantiate this tuple variant
396    |
397 LL |     let _: E = E::Fn(_);
398    |                     +++
399
400 error[E0618]: expected function, found enum variant `E::Unit`
401   --> $DIR/privacy-enum-ctor.rs:55:16
402    |
403 LL |         Unit,
404    |         ---- `E::Unit` defined here
405 ...
406 LL |     let _: E = E::Unit();
407    |                ^^^^^^^--
408    |                |
409    |                call expression requires function
410    |
411 help: `E::Unit` is a unit variant, you need to write it without the parentheses
412    |
413 LL -     let _: E = E::Unit();
414 LL +     let _: E = E::Unit;
415    | 
416
417 error: aborting due to 23 previous errors
418
419 Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618.
420 For more information about an error, try `rustc --explain E0308`.