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