fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

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