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