fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
10.9 KiB399 linesraw
1error[E0423]: expected value, found enum `n::Z`
2  --> $DIR/privacy-enum-ctor.rs:23:9
3   |
4LL |         n::Z;
5   |         ^^^^
6   |
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
19   |
20LL |         m::Z::Unit;
21   |         ~~~~~~~~~~
22help: alternatively, the following enum variant is available
23   |
24LL |         (m::Z::Fn(/* fields */));
25   |         ~~~~~~~~~~~~~~~~~~~~~~~~
26
27error[E0423]: expected value, found enum `Z`
28  --> $DIR/privacy-enum-ctor.rs:25:9
29   |
30LL |         Z;
31   |         ^
32   |
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
45   |
46LL |         m::Z::Unit;
47   |         ~~~~~~~~~~
48help: alternatively, the following enum variant is available
49   |
50LL |         (m::Z::Fn(/* fields */));
51   |         ~~~~~~~~~~~~~~~~~~~~~~~~
52
53error[E0423]: expected value, found enum `m::E`
54  --> $DIR/privacy-enum-ctor.rs:41:16
55   |
56LL |     fn f() {
57   |     ------ similarly named function `f` defined here
58...
59LL |     let _: E = m::E;
60   |                ^^^^
61   |
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
74   |
75LL |     let _: E = E::Unit;
76   |                ~~~~~~~
77help: alternatively, the following enum variant is available
78   |
79LL |     let _: E = (E::Fn(/* fields */));
80   |                ~~~~~~~~~~~~~~~~~~~~~
81help: a function with a similar name exists
82   |
83LL |     let _: E = m::f;
84   |                   ~
85help: consider importing one of these items instead
86   |
87LL + use std::f32::consts::E;
88   |
89LL + use std::f64::consts::E;
90   |
91help: if you import `E`, refer to it directly
92   |
93LL -     let _: E = m::E;
94LL +     let _: E = E;
95   |
96
97error[E0423]: expected value, found enum `E`
98  --> $DIR/privacy-enum-ctor.rs:49:16
99   |
100LL |     let _: E = E;
101   |                ^
102   |
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
115   |
116LL |     let _: E = E::Unit;
117   |                ~~~~~~~
118help: alternatively, the following enum variant is available
119   |
120LL |     let _: E = (E::Fn(/* fields */));
121   |                ~~~~~~~~~~~~~~~~~~~~~
122help: consider importing one of these items instead
123   |
124LL + use std::f32::consts::E;
125   |
126LL + use std::f64::consts::E;
127   |
128
129error[E0412]: cannot find type `Z` in this scope
130  --> $DIR/privacy-enum-ctor.rs:57:12
131   |
132LL |     pub enum E {
133   |     ---------- similarly named enum `E` defined here
134...
135LL |     let _: Z = m::n::Z;
136   |            ^ help: an enum with a similar name exists: `E`
137   |
138note: enum `m::Z` exists but is inaccessible
139  --> $DIR/privacy-enum-ctor.rs:11:9
140   |
141LL |         pub(in m) enum Z {
142   |         ^^^^^^^^^^^^^^^^ not accessible
143
144error[E0423]: expected value, found enum `m::n::Z`
145  --> $DIR/privacy-enum-ctor.rs:57:16
146   |
147LL |     let _: Z = m::n::Z;
148   |                ^^^^^^^
149   |
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
162   |
163LL |     let _: Z = m::Z::Unit;
164   |                ~~~~~~~~~~
165help: alternatively, the following enum variant is available
166   |
167LL |     let _: Z = (m::Z::Fn(/* fields */));
168   |                ~~~~~~~~~~~~~~~~~~~~~~~~
169
170error[E0412]: cannot find type `Z` in this scope
171  --> $DIR/privacy-enum-ctor.rs:61:12
172   |
173LL |     pub enum E {
174   |     ---------- similarly named enum `E` defined here
175...
176LL |     let _: Z = m::n::Z::Fn;
177   |            ^ help: an enum with a similar name exists: `E`
178   |
179note: enum `m::Z` exists but is inaccessible
180  --> $DIR/privacy-enum-ctor.rs:11:9
181   |
182LL |         pub(in m) enum Z {
183   |         ^^^^^^^^^^^^^^^^ not accessible
184
185error[E0412]: cannot find type `Z` in this scope
186  --> $DIR/privacy-enum-ctor.rs:64:12
187   |
188LL |     pub enum E {
189   |     ---------- similarly named enum `E` defined here
190...
191LL |     let _: Z = m::n::Z::Struct;
192   |            ^ help: an enum with a similar name exists: `E`
193   |
194note: enum `m::Z` exists but is inaccessible
195  --> $DIR/privacy-enum-ctor.rs:11:9
196   |
197LL |         pub(in m) enum Z {
198   |         ^^^^^^^^^^^^^^^^ not accessible
199
200error[E0412]: cannot find type `Z` in this scope
201  --> $DIR/privacy-enum-ctor.rs:68:12
202   |
203LL |     pub enum E {
204   |     ---------- similarly named enum `E` defined here
205...
206LL |     let _: Z = m::n::Z::Unit {};
207   |            ^ help: an enum with a similar name exists: `E`
208   |
209note: enum `m::Z` exists but is inaccessible
210  --> $DIR/privacy-enum-ctor.rs:11:9
211   |
212LL |         pub(in m) enum Z {
213   |         ^^^^^^^^^^^^^^^^ not accessible
214
215error[E0603]: enum `Z` is private
216  --> $DIR/privacy-enum-ctor.rs:57:22
217   |
218LL |     let _: Z = m::n::Z;
219   |                      ^ private enum
220   |
221note: the enum `Z` is defined here
222  --> $DIR/privacy-enum-ctor.rs:11:9
223   |
224LL |         pub(in m) enum Z {
225   |         ^^^^^^^^^^^^^^^^
226
227error[E0603]: enum `Z` is private
228  --> $DIR/privacy-enum-ctor.rs:61:22
229   |
230LL |     let _: Z = m::n::Z::Fn;
231   |                      ^  -- tuple variant `Fn` is not publicly re-exported
232   |                      |
233   |                      private enum
234   |
235note: the enum `Z` is defined here
236  --> $DIR/privacy-enum-ctor.rs:11:9
237   |
238LL |         pub(in m) enum Z {
239   |         ^^^^^^^^^^^^^^^^
240
241error[E0603]: enum `Z` is private
242  --> $DIR/privacy-enum-ctor.rs:64:22
243   |
244LL |     let _: Z = m::n::Z::Struct;
245   |                      ^ private enum
246   |
247note: the enum `Z` is defined here
248  --> $DIR/privacy-enum-ctor.rs:11:9
249   |
250LL |         pub(in m) enum Z {
251   |         ^^^^^^^^^^^^^^^^
252
253error[E0603]: enum `Z` is private
254  --> $DIR/privacy-enum-ctor.rs:68:22
255   |
256LL |     let _: Z = m::n::Z::Unit {};
257   |                      ^  ---- variant `Unit` is not publicly re-exported
258   |                      |
259   |                      private enum
260   |
261note: the enum `Z` is defined here
262  --> $DIR/privacy-enum-ctor.rs:11:9
263   |
264LL |         pub(in m) enum Z {
265   |         ^^^^^^^^^^^^^^^^
266
267error[E0308]: mismatched types
268  --> $DIR/privacy-enum-ctor.rs:27:20
269   |
270LL |             Fn(u8),
271   |             -- `Fn` defines an enum variant constructor here, which should be called
272...
273LL |         let _: Z = Z::Fn;
274   |                -   ^^^^^ expected `Z`, found enum constructor
275   |                |
276   |                expected due to this
277   |
278   = note:          expected enum `Z`
279           found enum constructor `fn(u8) -> Z {Z::Fn}`
280help: use parentheses to construct this tuple variant
281   |
282LL |         let _: Z = Z::Fn(/* u8 */);
283   |                         ++++++++++
284
285error[E0533]: expected value, found struct variant `Z::Struct`
286  --> $DIR/privacy-enum-ctor.rs:29:20
287   |
288LL |         let _: Z = Z::Struct;
289   |                    ^^^^^^^^^ not a value
290
291error[E0618]: expected function, found enum variant `Z::Unit`
292  --> $DIR/privacy-enum-ctor.rs:31:17
293   |
294LL |             Unit,
295   |             ---- enum variant `Z::Unit` defined here
296...
297LL |         let _ = Z::Unit();
298   |                 ^^^^^^^--
299   |                 |
300   |                 call expression requires function
301   |
302help: `Z::Unit` is a unit enum variant, and does not take parentheses to be constructed
303   |
304LL -         let _ = Z::Unit();
305LL +         let _ = Z::Unit;
306   |
307
308error[E0308]: mismatched types
309  --> $DIR/privacy-enum-ctor.rs:43:16
310   |
311LL |         Fn(u8),
312   |         -- `Fn` defines an enum variant constructor here, which should be called
313...
314LL |     let _: E = m::E::Fn;
315   |            -   ^^^^^^^^ expected `E`, found enum constructor
316   |            |
317   |            expected due to this
318   |
319   = note:          expected enum `E`
320           found enum constructor `fn(u8) -> E {E::Fn}`
321help: use parentheses to construct this tuple variant
322   |
323LL |     let _: E = m::E::Fn(/* u8 */);
324   |                        ++++++++++
325
326error[E0533]: expected value, found struct variant `m::E::Struct`
327  --> $DIR/privacy-enum-ctor.rs:45:16
328   |
329LL |     let _: E = m::E::Struct;
330   |                ^^^^^^^^^^^^ not a value
331
332error[E0618]: expected function, found enum variant `m::E::Unit`
333  --> $DIR/privacy-enum-ctor.rs:47:16
334   |
335LL |         Unit,
336   |         ---- enum variant `m::E::Unit` defined here
337...
338LL |     let _: E = m::E::Unit();
339   |                ^^^^^^^^^^--
340   |                |
341   |                call expression requires function
342   |
343help: `m::E::Unit` is a unit enum variant, and does not take parentheses to be constructed
344   |
345LL -     let _: E = m::E::Unit();
346LL +     let _: E = m::E::Unit;
347   |
348
349error[E0308]: mismatched types
350  --> $DIR/privacy-enum-ctor.rs:51:16
351   |
352LL |         Fn(u8),
353   |         -- `Fn` defines an enum variant constructor here, which should be called
354...
355LL |     let _: E = E::Fn;
356   |            -   ^^^^^ expected `E`, found enum constructor
357   |            |
358   |            expected due to this
359   |
360   = note:          expected enum `E`
361           found enum constructor `fn(u8) -> E {E::Fn}`
362help: use parentheses to construct this tuple variant
363   |
364LL |     let _: E = E::Fn(/* u8 */);
365   |                     ++++++++++
366
367error[E0533]: expected value, found struct variant `E::Struct`
368  --> $DIR/privacy-enum-ctor.rs:53:16
369   |
370LL |     let _: E = E::Struct;
371   |                ^^^^^^^^^ not a value
372
373error[E0618]: expected function, found enum variant `E::Unit`
374  --> $DIR/privacy-enum-ctor.rs:55:16
375   |
376LL |         Unit,
377   |         ---- enum variant `E::Unit` defined here
378...
379LL |     let _: E = E::Unit();
380   |                ^^^^^^^--
381   |                |
382   |                call expression requires function
383   |
384help: `E::Unit` is a unit enum variant, and does not take parentheses to be constructed
385   |
386LL -     let _: E = E::Unit();
387LL +     let _: E = E::Unit;
388   |
389
390error[E0533]: expected value, found struct variant `m::n::Z::Struct`
391  --> $DIR/privacy-enum-ctor.rs:64:16
392   |
393LL |     let _: Z = m::n::Z::Struct;
394   |                ^^^^^^^^^^^^^^^ not a value
395
396error: aborting due to 23 previous errors
397
398Some errors have detailed explanations: E0308, E0412, E0423, E0533, E0603, E0618.
399For more information about an error, try `rustc --explain E0308`.