]> git.proxmox.com Git - rustc.git/blob - src/test/ui/resolve/privacy-enum-ctor.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.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 | ^
173 |
174 help: an enum with a similar name exists
175 |
176 LL | let _: E = m::n::Z;
177 | ~
178 help: consider importing this enum
179 |
180 LL | use m::Z;
181 |
182
183 error[E0423]: expected value, found enum `m::n::Z`
184 --> $DIR/privacy-enum-ctor.rs:57:16
185 |
186 LL | let _: Z = m::n::Z;
187 | ^^^^^^^
188 |
189 note: the enum is defined here
190 --> $DIR/privacy-enum-ctor.rs:11:9
191 |
192 LL | / pub(in m) enum Z {
193 LL | | Fn(u8),
194 LL | | Struct {
195 LL | | s: u8,
196 LL | | },
197 LL | | Unit,
198 LL | | }
199 | |_________^
200 help: you might have meant to use the following enum variant
201 |
202 LL | let _: Z = m::Z::Unit;
203 | ~~~~~~~~~~
204 help: the following enum variants are available
205 |
206 LL | let _: Z = (m::Z::Fn(/* fields */));
207 | ~~~~~~~~~~~~~~~~~~~~~~~~
208 LL | let _: Z = (m::Z::Struct { /* fields */ });
209 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
211 error[E0412]: cannot find type `Z` in this scope
212 --> $DIR/privacy-enum-ctor.rs:61:12
213 |
214 LL | pub enum E {
215 | ---------- similarly named enum `E` defined here
216 ...
217 LL | let _: Z = m::n::Z::Fn;
218 | ^
219 |
220 help: an enum with a similar name exists
221 |
222 LL | let _: E = m::n::Z::Fn;
223 | ~
224 help: consider importing this enum
225 |
226 LL | use m::Z;
227 |
228
229 error[E0412]: cannot find type `Z` in this scope
230 --> $DIR/privacy-enum-ctor.rs:64:12
231 |
232 LL | pub enum E {
233 | ---------- similarly named enum `E` defined here
234 ...
235 LL | let _: Z = m::n::Z::Struct;
236 | ^
237 |
238 help: an enum with a similar name exists
239 |
240 LL | let _: E = m::n::Z::Struct;
241 | ~
242 help: consider importing this enum
243 |
244 LL | use m::Z;
245 |
246
247 error[E0423]: expected value, found struct variant `m::n::Z::Struct`
248 --> $DIR/privacy-enum-ctor.rs:64:16
249 |
250 LL | / Struct {
251 LL | | s: u8,
252 LL | | },
253 | |_____________- `m::n::Z::Struct` defined here
254 ...
255 LL | let _: Z = m::n::Z::Struct;
256 | ^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `m::n::Z::Struct { s: val }`
257
258 error[E0412]: cannot find type `Z` in this scope
259 --> $DIR/privacy-enum-ctor.rs:68:12
260 |
261 LL | pub enum E {
262 | ---------- similarly named enum `E` defined here
263 ...
264 LL | let _: Z = m::n::Z::Unit {};
265 | ^
266 |
267 help: an enum with a similar name exists
268 |
269 LL | let _: E = m::n::Z::Unit {};
270 | ~
271 help: consider importing this enum
272 |
273 LL | use m::Z;
274 |
275
276 error[E0603]: enum `Z` is private
277 --> $DIR/privacy-enum-ctor.rs:57:22
278 |
279 LL | let _: Z = m::n::Z;
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:61:22
290 |
291 LL | let _: Z = m::n::Z::Fn;
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:64:22
302 |
303 LL | let _: Z = m::n::Z::Struct;
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[E0603]: enum `Z` is private
313 --> $DIR/privacy-enum-ctor.rs:68:22
314 |
315 LL | let _: Z = m::n::Z::Unit {};
316 | ^ private enum
317 |
318 note: the enum `Z` is defined here
319 --> $DIR/privacy-enum-ctor.rs:11:9
320 |
321 LL | pub(in m) enum Z {
322 | ^^^^^^^^^^^^^^^^
323
324 error[E0308]: mismatched types
325 --> $DIR/privacy-enum-ctor.rs:27:20
326 |
327 LL | Fn(u8),
328 | ------ fn(u8) -> Z {Z::Fn} defined here
329 ...
330 LL | let _: Z = Z::Fn;
331 | - ^^^^^ expected enum `Z`, found fn item
332 | |
333 | expected due to this
334 |
335 = note: expected enum `Z`
336 found fn item `fn(u8) -> Z {Z::Fn}`
337 help: use parentheses to instantiate this tuple variant
338 |
339 LL | let _: Z = Z::Fn(_);
340 | +++
341
342 error[E0618]: expected function, found enum variant `Z::Unit`
343 --> $DIR/privacy-enum-ctor.rs:31:17
344 |
345 LL | Unit,
346 | ---- `Z::Unit` defined here
347 ...
348 LL | let _ = Z::Unit();
349 | ^^^^^^^--
350 | |
351 | call expression requires function
352 |
353 help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
354 |
355 LL | let _ = Z::Unit;
356 | ~~~~~~~
357
358 error[E0308]: mismatched types
359 --> $DIR/privacy-enum-ctor.rs:43:16
360 |
361 LL | Fn(u8),
362 | ------ fn(u8) -> E {E::Fn} defined here
363 ...
364 LL | let _: E = m::E::Fn;
365 | - ^^^^^^^^ expected enum `E`, found fn item
366 | |
367 | expected due to this
368 |
369 = note: expected enum `E`
370 found fn item `fn(u8) -> E {E::Fn}`
371 help: use parentheses to instantiate this tuple variant
372 |
373 LL | let _: E = m::E::Fn(_);
374 | +++
375
376 error[E0618]: expected function, found enum variant `m::E::Unit`
377 --> $DIR/privacy-enum-ctor.rs:47:16
378 |
379 LL | Unit,
380 | ---- `m::E::Unit` defined here
381 ...
382 LL | let _: E = m::E::Unit();
383 | ^^^^^^^^^^--
384 | |
385 | call expression requires function
386 |
387 help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
388 |
389 LL | let _: E = m::E::Unit;
390 | ~~~~~~~~~~
391
392 error[E0308]: mismatched types
393 --> $DIR/privacy-enum-ctor.rs:51:16
394 |
395 LL | Fn(u8),
396 | ------ fn(u8) -> E {E::Fn} defined here
397 ...
398 LL | let _: E = E::Fn;
399 | - ^^^^^ expected enum `E`, found fn item
400 | |
401 | expected due to this
402 |
403 = note: expected enum `E`
404 found fn item `fn(u8) -> E {E::Fn}`
405 help: use parentheses to instantiate this tuple variant
406 |
407 LL | let _: E = E::Fn(_);
408 | +++
409
410 error[E0618]: expected function, found enum variant `E::Unit`
411 --> $DIR/privacy-enum-ctor.rs:55:16
412 |
413 LL | Unit,
414 | ---- `E::Unit` defined here
415 ...
416 LL | let _: E = E::Unit();
417 | ^^^^^^^--
418 | |
419 | call expression requires function
420 |
421 help: `E::Unit` is a unit variant, you need to write it without the parenthesis
422 |
423 LL | let _: E = E::Unit;
424 | ~~~~~~~
425
426 error: aborting due to 23 previous errors
427
428 Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618.
429 For more information about an error, try `rustc --explain E0308`.