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