]> git.proxmox.com Git - rustc.git/blob - src/test/ui/resolve/privacy-enum-ctor.stderr
New upstream version 1.45.0+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 help: try using one of the enum's variants
8 |
9 LL | m::Z::Fn;
10 | ^^^^^^^^
11 LL | m::Z::Struct;
12 | ^^^^^^^^^^^^
13 LL | m::Z::Unit;
14 | ^^^^^^^^^^
15
16 error[E0423]: expected value, found enum `Z`
17 --> $DIR/privacy-enum-ctor.rs:25:9
18 |
19 LL | fn f() {
20 | ------ similarly named function `f` defined here
21 ...
22 LL | Z;
23 | ^
24 |
25 help: a function with a similar name exists
26 |
27 LL | f;
28 | ^
29 help: try using one of the enum's variants
30 |
31 LL | m::Z::Fn;
32 | ^^^^^^^^
33 LL | m::Z::Struct;
34 | ^^^^^^^^^^^^
35 LL | m::Z::Unit;
36 | ^^^^^^^^^^
37
38 error[E0423]: expected value, found struct variant `Z::Struct`
39 --> $DIR/privacy-enum-ctor.rs:29:20
40 |
41 LL | / Struct {
42 LL | | s: u8,
43 LL | | },
44 | |_____________- `Z::Struct` defined here
45 ...
46 LL | let _: Z = Z::Struct;
47 | ^^^^^^^^^ did you mean `Z::Struct { /* fields */ }`?
48
49 error[E0423]: expected value, found enum `m::E`
50 --> $DIR/privacy-enum-ctor.rs:41:16
51 |
52 LL | fn f() {
53 | ------ similarly named function `f` defined here
54 ...
55 LL | let _: E = m::E;
56 | ^^^^
57 |
58 help: a function with a similar name exists
59 |
60 LL | let _: E = m::f;
61 | ^
62 help: try using one of the enum's variants
63 |
64 LL | let _: E = E::Fn;
65 | ^^^^^
66 LL | let _: E = E::Struct;
67 | ^^^^^^^^^
68 LL | let _: E = E::Unit;
69 | ^^^^^^^
70 help: consider importing one of these items instead
71 |
72 LL | use std::f32::consts::E;
73 |
74 LL | use std::f64::consts::E;
75 |
76
77 error[E0423]: expected value, found struct variant `m::E::Struct`
78 --> $DIR/privacy-enum-ctor.rs:45:16
79 |
80 LL | / Struct {
81 LL | | s: u8,
82 LL | | },
83 | |_________- `m::E::Struct` defined here
84 ...
85 LL | let _: E = m::E::Struct;
86 | ^^^^^^^^^^^^ did you mean `m::E::Struct { /* fields */ }`?
87
88 error[E0423]: expected value, found enum `E`
89 --> $DIR/privacy-enum-ctor.rs:49:16
90 |
91 LL | let _: E = E;
92 | ^
93 |
94 help: try using one of the enum's variants
95 |
96 LL | let _: E = E::Fn;
97 | ^^^^^
98 LL | let _: E = E::Struct;
99 | ^^^^^^^^^
100 LL | let _: E = E::Unit;
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 `E::Struct`
110 --> $DIR/privacy-enum-ctor.rs:53:16
111 |
112 LL | / Struct {
113 LL | | s: u8,
114 LL | | },
115 | |_________- `E::Struct` defined here
116 ...
117 LL | let _: E = E::Struct;
118 | ^^^^^^^^^ did you mean `E::Struct { /* fields */ }`?
119
120 error[E0412]: cannot find type `Z` in this scope
121 --> $DIR/privacy-enum-ctor.rs:57:12
122 |
123 LL | pub enum E {
124 | ---------- similarly named enum `E` defined here
125 ...
126 LL | let _: Z = m::n::Z;
127 | ^
128 |
129 help: an enum with a similar name exists
130 |
131 LL | let _: E = m::n::Z;
132 | ^
133 help: consider importing this enum
134 |
135 LL | use m::n::Z;
136 |
137
138 error[E0423]: expected value, found enum `m::n::Z`
139 --> $DIR/privacy-enum-ctor.rs:57:16
140 |
141 LL | let _: Z = m::n::Z;
142 | ^^^^^^^
143 |
144 help: try using one of the enum's variants
145 |
146 LL | let _: Z = m::Z::Fn;
147 | ^^^^^^^^
148 LL | let _: Z = m::Z::Struct;
149 | ^^^^^^^^^^^^
150 LL | let _: Z = m::Z::Unit;
151 | ^^^^^^^^^^
152
153 error[E0412]: cannot find type `Z` in this scope
154 --> $DIR/privacy-enum-ctor.rs:61:12
155 |
156 LL | pub enum E {
157 | ---------- similarly named enum `E` defined here
158 ...
159 LL | let _: Z = m::n::Z::Fn;
160 | ^
161 |
162 help: an enum with a similar name exists
163 |
164 LL | let _: E = m::n::Z::Fn;
165 | ^
166 help: consider importing this enum
167 |
168 LL | use m::n::Z;
169 |
170
171 error[E0412]: cannot find type `Z` in this scope
172 --> $DIR/privacy-enum-ctor.rs:64:12
173 |
174 LL | pub enum E {
175 | ---------- similarly named enum `E` defined here
176 ...
177 LL | let _: Z = m::n::Z::Struct;
178 | ^
179 |
180 help: an enum with a similar name exists
181 |
182 LL | let _: E = m::n::Z::Struct;
183 | ^
184 help: consider importing this enum
185 |
186 LL | use m::n::Z;
187 |
188
189 error[E0423]: expected value, found struct variant `m::n::Z::Struct`
190 --> $DIR/privacy-enum-ctor.rs:64:16
191 |
192 LL | / Struct {
193 LL | | s: u8,
194 LL | | },
195 | |_____________- `m::n::Z::Struct` defined here
196 ...
197 LL | let _: Z = m::n::Z::Struct;
198 | ^^^^^^^^^^^^^^^ did you mean `m::n::Z::Struct { /* fields */ }`?
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 | ^
208 |
209 help: an enum with a similar name exists
210 |
211 LL | let _: E = m::n::Z::Unit {};
212 | ^
213 help: consider importing this enum
214 |
215 LL | use m::n::Z;
216 |
217
218 error[E0603]: enum `Z` is private
219 --> $DIR/privacy-enum-ctor.rs:57:22
220 |
221 LL | let _: Z = m::n::Z;
222 | ^ private enum
223 |
224 note: the enum `Z` is defined here
225 --> $DIR/privacy-enum-ctor.rs:11:9
226 |
227 LL | pub(in m) enum Z {
228 | ^^^^^^^^^^^^^^^^
229
230 error[E0603]: enum `Z` is private
231 --> $DIR/privacy-enum-ctor.rs:61:22
232 |
233 LL | let _: Z = m::n::Z::Fn;
234 | ^ private enum
235 |
236 note: the enum `Z` is defined here
237 --> $DIR/privacy-enum-ctor.rs:11:9
238 |
239 LL | pub(in m) enum Z {
240 | ^^^^^^^^^^^^^^^^
241
242 error[E0603]: enum `Z` is private
243 --> $DIR/privacy-enum-ctor.rs:64:22
244 |
245 LL | let _: Z = m::n::Z::Struct;
246 | ^ private enum
247 |
248 note: the enum `Z` is defined here
249 --> $DIR/privacy-enum-ctor.rs:11:9
250 |
251 LL | pub(in m) enum Z {
252 | ^^^^^^^^^^^^^^^^
253
254 error[E0603]: enum `Z` is private
255 --> $DIR/privacy-enum-ctor.rs:68:22
256 |
257 LL | let _: Z = m::n::Z::Unit {};
258 | ^ private enum
259 |
260 note: the enum `Z` is defined here
261 --> $DIR/privacy-enum-ctor.rs:11:9
262 |
263 LL | pub(in m) enum Z {
264 | ^^^^^^^^^^^^^^^^
265
266 error[E0308]: mismatched types
267 --> $DIR/privacy-enum-ctor.rs:27:20
268 |
269 LL | Fn(u8),
270 | ------ fn(u8) -> m::n::Z {m::n::Z::Fn} defined here
271 ...
272 LL | let _: Z = Z::Fn;
273 | - ^^^^^ expected enum `m::n::Z`, found fn item
274 | |
275 | expected due to this
276 |
277 = note: expected enum `m::n::Z`
278 found fn item `fn(u8) -> m::n::Z {m::n::Z::Fn}`
279 help: use parentheses to instantiate this tuple variant
280 |
281 LL | let _: Z = Z::Fn(_);
282 | ^^^
283
284 error[E0618]: expected function, found enum variant `Z::Unit`
285 --> $DIR/privacy-enum-ctor.rs:31:17
286 |
287 LL | Unit,
288 | ---- `Z::Unit` defined here
289 ...
290 LL | let _ = Z::Unit();
291 | ^^^^^^^--
292 | |
293 | call expression requires function
294 |
295 help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
296 |
297 LL | let _ = Z::Unit;
298 | ^^^^^^^
299
300 error[E0308]: mismatched types
301 --> $DIR/privacy-enum-ctor.rs:43:16
302 |
303 LL | Fn(u8),
304 | ------ fn(u8) -> m::E {m::E::Fn} defined here
305 ...
306 LL | let _: E = m::E::Fn;
307 | - ^^^^^^^^ expected enum `m::E`, found fn item
308 | |
309 | expected due to this
310 |
311 = note: expected enum `m::E`
312 found fn item `fn(u8) -> m::E {m::E::Fn}`
313 help: use parentheses to instantiate this tuple variant
314 |
315 LL | let _: E = m::E::Fn(_);
316 | ^^^
317
318 error[E0618]: expected function, found enum variant `m::E::Unit`
319 --> $DIR/privacy-enum-ctor.rs:47:16
320 |
321 LL | Unit,
322 | ---- `m::E::Unit` defined here
323 ...
324 LL | let _: E = m::E::Unit();
325 | ^^^^^^^^^^--
326 | |
327 | call expression requires function
328 |
329 help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
330 |
331 LL | let _: E = m::E::Unit;
332 | ^^^^^^^^^^
333
334 error[E0308]: mismatched types
335 --> $DIR/privacy-enum-ctor.rs:51:16
336 |
337 LL | Fn(u8),
338 | ------ fn(u8) -> m::E {m::E::Fn} defined here
339 ...
340 LL | let _: E = E::Fn;
341 | - ^^^^^ expected enum `m::E`, found fn item
342 | |
343 | expected due to this
344 |
345 = note: expected enum `m::E`
346 found fn item `fn(u8) -> m::E {m::E::Fn}`
347 help: use parentheses to instantiate this tuple variant
348 |
349 LL | let _: E = E::Fn(_);
350 | ^^^
351
352 error[E0618]: expected function, found enum variant `E::Unit`
353 --> $DIR/privacy-enum-ctor.rs:55:16
354 |
355 LL | Unit,
356 | ---- `E::Unit` defined here
357 ...
358 LL | let _: E = E::Unit();
359 | ^^^^^^^--
360 | |
361 | call expression requires function
362 |
363 help: `E::Unit` is a unit variant, you need to write it without the parenthesis
364 |
365 LL | let _: E = E::Unit;
366 | ^^^^^^^
367
368 error: aborting due to 23 previous errors
369
370 Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618.
371 For more information about an error, try `rustc --explain E0308`.