]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/privacy-enum-ctor.stderr
Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum
[rust.git] / tests / 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: alternatively, the following enum variant is available
23    |
24 LL |         (m::Z::Fn(/* fields */));
25    |         ~~~~~~~~~~~~~~~~~~~~~~~~
26
27 error[E0423]: expected value, found enum `Z`
28   --> $DIR/privacy-enum-ctor.rs:25:9
29    |
30 LL |         Z;
31    |         ^
32    |
33 note: the enum is defined here
34   --> $DIR/privacy-enum-ctor.rs:11:9
35    |
36 LL | /         pub(in m) enum Z {
37 LL | |             Fn(u8),
38 LL | |             Struct {
39 LL | |                 s: u8,
40 LL | |             },
41 LL | |             Unit,
42 LL | |         }
43    | |_________^
44 help: you might have meant to use the following enum variant
45    |
46 LL |         m::Z::Unit;
47    |         ~~~~~~~~~~
48 help: alternatively, the following enum variant is available
49    |
50 LL |         (m::Z::Fn(/* fields */));
51    |         ~~~~~~~~~~~~~~~~~~~~~~~~
52
53 error[E0423]: expected value, found enum `m::E`
54   --> $DIR/privacy-enum-ctor.rs:41:16
55    |
56 LL |     fn f() {
57    |     ------ similarly named function `f` defined here
58 ...
59 LL |     let _: E = m::E;
60    |                ^^^^
61    |
62 note: the enum is defined here
63   --> $DIR/privacy-enum-ctor.rs:2:5
64    |
65 LL | /     pub enum E {
66 LL | |         Fn(u8),
67 LL | |         Struct {
68 LL | |             s: u8,
69 LL | |         },
70 LL | |         Unit,
71 LL | |     }
72    | |_____^
73 help: you might have meant to use the following enum variant
74    |
75 LL |     let _: E = E::Unit;
76    |                ~~~~~~~
77 help: alternatively, the following enum variant is available
78    |
79 LL |     let _: E = (E::Fn(/* fields */));
80    |                ~~~~~~~~~~~~~~~~~~~~~
81 help: a function with a similar name exists
82    |
83 LL |     let _: E = m::f;
84    |                   ~
85 help: consider importing one of these items instead
86    |
87 LL | use std::f32::consts::E;
88    |
89 LL | use std::f64::consts::E;
90    |
91 help: if you import `E`, refer to it directly
92    |
93 LL -     let _: E = m::E;
94 LL +     let _: E = E;
95    |
96
97 error[E0423]: expected value, found enum `E`
98   --> $DIR/privacy-enum-ctor.rs:49:16
99    |
100 LL |     let _: E = E;
101    |                ^
102    |
103 note: the enum is defined here
104   --> $DIR/privacy-enum-ctor.rs:2:5
105    |
106 LL | /     pub enum E {
107 LL | |         Fn(u8),
108 LL | |         Struct {
109 LL | |             s: u8,
110 LL | |         },
111 LL | |         Unit,
112 LL | |     }
113    | |_____^
114 help: you might have meant to use the following enum variant
115    |
116 LL |     let _: E = E::Unit;
117    |                ~~~~~~~
118 help: alternatively, the following enum variant is available
119    |
120 LL |     let _: E = (E::Fn(/* fields */));
121    |                ~~~~~~~~~~~~~~~~~~~~~
122 help: consider importing one of these items instead
123    |
124 LL | use std::f32::consts::E;
125    |
126 LL | use std::f64::consts::E;
127    |
128
129 error[E0412]: cannot find type `Z` in this scope
130   --> $DIR/privacy-enum-ctor.rs:57:12
131    |
132 LL |     pub enum E {
133    |     ---------- similarly named enum `E` defined here
134 ...
135 LL |     let _: Z = m::n::Z;
136    |            ^ help: an enum with a similar name exists: `E`
137    |
138 note: enum `m::Z` exists but is inaccessible
139   --> $DIR/privacy-enum-ctor.rs:11:9
140    |
141 LL |         pub(in m) enum Z {
142    |         ^^^^^^^^^^^^^^^^ not accessible
143
144 error[E0423]: expected value, found enum `m::n::Z`
145   --> $DIR/privacy-enum-ctor.rs:57:16
146    |
147 LL |     let _: Z = m::n::Z;
148    |                ^^^^^^^
149    |
150 note: the enum is defined here
151   --> $DIR/privacy-enum-ctor.rs:11:9
152    |
153 LL | /         pub(in m) enum Z {
154 LL | |             Fn(u8),
155 LL | |             Struct {
156 LL | |                 s: u8,
157 LL | |             },
158 LL | |             Unit,
159 LL | |         }
160    | |_________^
161 help: you might have meant to use the following enum variant
162    |
163 LL |     let _: Z = m::Z::Unit;
164    |                ~~~~~~~~~~
165 help: alternatively, the following enum variant is available
166    |
167 LL |     let _: Z = (m::Z::Fn(/* fields */));
168    |                ~~~~~~~~~~~~~~~~~~~~~~~~
169
170 error[E0412]: cannot find type `Z` in this scope
171   --> $DIR/privacy-enum-ctor.rs:61:12
172    |
173 LL |     pub enum E {
174    |     ---------- similarly named enum `E` defined here
175 ...
176 LL |     let _: Z = m::n::Z::Fn;
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[E0412]: cannot find type `Z` in this scope
186   --> $DIR/privacy-enum-ctor.rs:64:12
187    |
188 LL |     pub enum E {
189    |     ---------- similarly named enum `E` defined here
190 ...
191 LL |     let _: Z = m::n::Z::Struct;
192    |            ^ help: an enum with a similar name exists: `E`
193    |
194 note: enum `m::Z` exists but is inaccessible
195   --> $DIR/privacy-enum-ctor.rs:11:9
196    |
197 LL |         pub(in m) enum Z {
198    |         ^^^^^^^^^^^^^^^^ not accessible
199
200 error[E0412]: cannot find type `Z` in this scope
201   --> $DIR/privacy-enum-ctor.rs:68:12
202    |
203 LL |     pub enum E {
204    |     ---------- similarly named enum `E` defined here
205 ...
206 LL |     let _: Z = m::n::Z::Unit {};
207    |            ^ help: an enum with a similar name exists: `E`
208    |
209 note: enum `m::Z` exists but is inaccessible
210   --> $DIR/privacy-enum-ctor.rs:11:9
211    |
212 LL |         pub(in m) enum Z {
213    |         ^^^^^^^^^^^^^^^^ not accessible
214
215 error[E0603]: enum `Z` is private
216   --> $DIR/privacy-enum-ctor.rs:57:22
217    |
218 LL |     let _: Z = m::n::Z;
219    |                      ^ private enum
220    |
221 note: the enum `Z` is defined here
222   --> $DIR/privacy-enum-ctor.rs:11:9
223    |
224 LL |         pub(in m) enum Z {
225    |         ^^^^^^^^^^^^^^^^
226
227 error[E0603]: enum `Z` is private
228   --> $DIR/privacy-enum-ctor.rs:61:22
229    |
230 LL |     let _: Z = m::n::Z::Fn;
231    |                      ^ private enum
232    |
233 note: the enum `Z` is defined here
234   --> $DIR/privacy-enum-ctor.rs:11:9
235    |
236 LL |         pub(in m) enum Z {
237    |         ^^^^^^^^^^^^^^^^
238
239 error[E0603]: enum `Z` is private
240   --> $DIR/privacy-enum-ctor.rs:64:22
241    |
242 LL |     let _: Z = m::n::Z::Struct;
243    |                      ^ private enum
244    |
245 note: the enum `Z` is defined here
246   --> $DIR/privacy-enum-ctor.rs:11:9
247    |
248 LL |         pub(in m) enum Z {
249    |         ^^^^^^^^^^^^^^^^
250
251 error[E0603]: enum `Z` is private
252   --> $DIR/privacy-enum-ctor.rs:68:22
253    |
254 LL |     let _: Z = m::n::Z::Unit {};
255    |                      ^ private enum
256    |
257 note: the enum `Z` is defined here
258   --> $DIR/privacy-enum-ctor.rs:11:9
259    |
260 LL |         pub(in m) enum Z {
261    |         ^^^^^^^^^^^^^^^^
262
263 error[E0308]: mismatched types
264   --> $DIR/privacy-enum-ctor.rs:27:20
265    |
266 LL |             Fn(u8),
267    |             -- `Fn` defines an enum variant constructor here, which should be called
268 ...
269 LL |         let _: Z = Z::Fn;
270    |                -   ^^^^^ expected enum `Z`, found enum constructor
271    |                |
272    |                expected due to this
273    |
274    = note:          expected enum `Z`
275            found enum constructor `fn(u8) -> Z {Z::Fn}`
276 help: use parentheses to construct this tuple variant
277    |
278 LL |         let _: Z = Z::Fn(/* u8 */);
279    |                         ++++++++++
280
281 error[E0533]: expected value, found struct variant `Z::Struct`
282   --> $DIR/privacy-enum-ctor.rs:29:20
283    |
284 LL |         let _: Z = Z::Struct;
285    |                    ^^^^^^^^^ not a value
286
287 error[E0618]: expected function, found enum variant `Z::Unit`
288   --> $DIR/privacy-enum-ctor.rs:31:17
289    |
290 LL |             Unit,
291    |             ---- enum variant `Z::Unit` defined here
292 ...
293 LL |         let _ = Z::Unit();
294    |                 ^^^^^^^--
295    |                 |
296    |                 call expression requires function
297    |
298 help: `Z::Unit` is a unit enum variant, and does not take parentheses to be constructed
299    |
300 LL -         let _ = Z::Unit();
301 LL +         let _ = Z::Unit;
302    |
303
304 error[E0308]: mismatched types
305   --> $DIR/privacy-enum-ctor.rs:43:16
306    |
307 LL |         Fn(u8),
308    |         -- `Fn` defines an enum variant constructor here, which should be called
309 ...
310 LL |     let _: E = m::E::Fn;
311    |            -   ^^^^^^^^ expected enum `E`, found enum constructor
312    |            |
313    |            expected due to this
314    |
315    = note:          expected enum `E`
316            found enum constructor `fn(u8) -> E {E::Fn}`
317 help: use parentheses to construct this tuple variant
318    |
319 LL |     let _: E = m::E::Fn(/* u8 */);
320    |                        ++++++++++
321
322 error[E0533]: expected value, found struct variant `m::E::Struct`
323   --> $DIR/privacy-enum-ctor.rs:45:16
324    |
325 LL |     let _: E = m::E::Struct;
326    |                ^^^^^^^^^^^^ not a value
327
328 error[E0618]: expected function, found enum variant `m::E::Unit`
329   --> $DIR/privacy-enum-ctor.rs:47:16
330    |
331 LL |         Unit,
332    |         ---- enum variant `m::E::Unit` defined here
333 ...
334 LL |     let _: E = m::E::Unit();
335    |                ^^^^^^^^^^--
336    |                |
337    |                call expression requires function
338    |
339 help: `m::E::Unit` is a unit enum variant, and does not take parentheses to be constructed
340    |
341 LL -     let _: E = m::E::Unit();
342 LL +     let _: E = m::E::Unit;
343    |
344
345 error[E0308]: mismatched types
346   --> $DIR/privacy-enum-ctor.rs:51:16
347    |
348 LL |         Fn(u8),
349    |         -- `Fn` defines an enum variant constructor here, which should be called
350 ...
351 LL |     let _: E = E::Fn;
352    |            -   ^^^^^ expected enum `E`, found enum constructor
353    |            |
354    |            expected due to this
355    |
356    = note:          expected enum `E`
357            found enum constructor `fn(u8) -> E {E::Fn}`
358 help: use parentheses to construct this tuple variant
359    |
360 LL |     let _: E = E::Fn(/* u8 */);
361    |                     ++++++++++
362
363 error[E0533]: expected value, found struct variant `E::Struct`
364   --> $DIR/privacy-enum-ctor.rs:53:16
365    |
366 LL |     let _: E = E::Struct;
367    |                ^^^^^^^^^ not a value
368
369 error[E0618]: expected function, found enum variant `E::Unit`
370   --> $DIR/privacy-enum-ctor.rs:55:16
371    |
372 LL |         Unit,
373    |         ---- enum variant `E::Unit` defined here
374 ...
375 LL |     let _: E = E::Unit();
376    |                ^^^^^^^--
377    |                |
378    |                call expression requires function
379    |
380 help: `E::Unit` is a unit enum variant, and does not take parentheses to be constructed
381    |
382 LL -     let _: E = E::Unit();
383 LL +     let _: E = E::Unit;
384    |
385
386 error[E0533]: expected value, found struct variant `m::n::Z::Struct`
387   --> $DIR/privacy-enum-ctor.rs:64:16
388    |
389 LL |     let _: Z = m::n::Z::Struct;
390    |                ^^^^^^^^^^^^^^^ not a value
391
392 error: aborting due to 23 previous errors
393
394 Some errors have detailed explanations: E0308, E0412, E0423, E0533, E0603, E0618.
395 For more information about an error, try `rustc --explain E0308`.