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