fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
10.5 KiB399 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() {
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   |
29help: a function with a similar name exists
30   |
31LL |         f;
32   |         ^
33help: try using one of the enum's variants
34   |
35LL |         m::Z::Fn;
36   |         ^^^^^^^^
37LL |         m::Z::Struct;
38   |         ^^^^^^^^^^^^
39LL |         m::Z::Unit;
40   |         ^^^^^^^^^^
41
42error[E0423]: expected value, found struct variant `Z::Struct`
43  --> $DIR/privacy-enum-ctor.rs:29:20
44   |
45LL | /             Struct {
46LL | |                 s: u8,
47LL | |             },
48   | |_____________- `Z::Struct` defined here
49...
50LL |           let _: Z = Z::Struct;
51   |                      ^^^^^^^^^ did you mean `Z::Struct { /* fields */ }`?
52
53error[E0423]: expected value, found enum `m::E`
54  --> $DIR/privacy-enum-ctor.rs:41:16
55   |
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   |
68help: a function with a similar name exists
69   |
70LL |     let _: E = m::f;
71   |                   ^
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   |                ^^^^^^^
80help: possible better candidates are found in other modules, you can import them into scope
81   |
82LL | use std::f32::consts::E;
83   |
84LL | use std::f64::consts::E;
85   |
86
87error[E0423]: expected value, found struct variant `m::E::Struct`
88  --> $DIR/privacy-enum-ctor.rs:45:16
89   |
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 */ }`?
97
98error[E0423]: expected value, found enum `E`
99  --> $DIR/privacy-enum-ctor.rs:49:16
100   |
101LL |     let _: E = E;
102   |                ^
103   |
104help: try using one of the enum's variants
105   |
106LL |     let _: E = E::Fn;
107   |                ^^^^^
108LL |     let _: E = E::Struct;
109   |                ^^^^^^^^^
110LL |     let _: E = E::Unit;
111   |                ^^^^^^^
112help: possible better candidates are found in other modules, you can import them into scope
113   |
114LL | use std::f32::consts::E;
115   |
116LL | use std::f64::consts::E;
117   |
118
119error[E0423]: expected value, found struct variant `E::Struct`
120  --> $DIR/privacy-enum-ctor.rs:53:16
121   |
122LL | /         Struct {
123LL | |             s: u8,
124LL | |         },
125   | |_________- `E::Struct` defined here
126...
127LL |       let _: E = E::Struct;
128   |                  ^^^^^^^^^ did you mean `E::Struct { /* fields */ }`?
129
130error[E0412]: cannot find type `Z` in this scope
131  --> $DIR/privacy-enum-ctor.rs:57:12
132   |
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   |
145help: an enum with a similar name exists
146   |
147LL |     let _: E = m::n::Z;
148   |            ^
149help: possible candidate is found in another module, you can import it into scope
150   |
151LL | use m::n::Z;
152   |
153
154error[E0423]: expected value, found enum `m::n::Z`
155  --> $DIR/privacy-enum-ctor.rs:57:16
156   |
157LL |     let _: Z = m::n::Z;
158   |                ^^^^^^^
159   |
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   |                ^^^^^^^^^^
168
169error[E0412]: cannot find type `Z` in this scope
170  --> $DIR/privacy-enum-ctor.rs:61:12
171   |
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   |
184help: an enum with a similar name exists
185   |
186LL |     let _: E = m::n::Z::Fn;
187   |            ^
188help: possible candidate is found in another module, you can import it into scope
189   |
190LL | use m::n::Z;
191   |
192
193error[E0412]: cannot find type `Z` in this scope
194  --> $DIR/privacy-enum-ctor.rs:64:12
195   |
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   |
208help: an enum with a similar name exists
209   |
210LL |     let _: E = m::n::Z::Struct;
211   |            ^
212help: possible candidate is found in another module, you can import it into scope
213   |
214LL | use m::n::Z;
215   |
216
217error[E0423]: expected value, found struct variant `m::n::Z::Struct`
218  --> $DIR/privacy-enum-ctor.rs:64:16
219   |
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 */ }`?
227
228error[E0412]: cannot find type `Z` in this scope
229  --> $DIR/privacy-enum-ctor.rs:68:12
230   |
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   |
243help: an enum with a similar name exists
244   |
245LL |     let _: E = m::n::Z::Unit {};
246   |            ^
247help: possible candidate is found in another module, you can import it into scope
248   |
249LL | use m::n::Z;
250   |
251
252error[E0603]: enum `Z` is private
253  --> $DIR/privacy-enum-ctor.rs:57:22
254   |
255LL |     let _: Z = m::n::Z;
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   |         ^^^^^^^^^^^^^^^^
263
264error[E0603]: enum `Z` is private
265  --> $DIR/privacy-enum-ctor.rs:61:22
266   |
267LL |     let _: Z = m::n::Z::Fn;
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   |         ^^^^^^^^^^^^^^^^
275
276error[E0603]: enum `Z` is private
277  --> $DIR/privacy-enum-ctor.rs:64:22
278   |
279LL |     let _: Z = m::n::Z::Struct;
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   |         ^^^^^^^^^^^^^^^^
287
288error[E0603]: enum `Z` is private
289  --> $DIR/privacy-enum-ctor.rs:68:22
290   |
291LL |     let _: Z = m::n::Z::Unit {};
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   |         ^^^^^^^^^^^^^^^^
299
300error[E0308]: mismatched types
301  --> $DIR/privacy-enum-ctor.rs:27:20
302   |
303LL |             Fn(u8),
304   |             ------ fn(u8) -> m::n::Z {m::n::Z::Fn} defined here
305...
306LL |         let _: Z = Z::Fn;
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}`
315
316error[E0618]: expected function, found enum variant `Z::Unit`
317  --> $DIR/privacy-enum-ctor.rs:31:17
318   |
319LL |             Unit,
320   |             ---- `Z::Unit` defined here
321...
322LL |         let _ = Z::Unit();
323   |                 ^^^^^^^--
324   |                 |
325   |                 call expression requires function
326   |
327help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
328   |
329LL |         let _ = Z::Unit;
330   |                 ^^^^^^^
331
332error[E0308]: mismatched types
333  --> $DIR/privacy-enum-ctor.rs:43:16
334   |
335LL |         Fn(u8),
336   |         ------ fn(u8) -> m::E {m::E::Fn} defined here
337...
338LL |     let _: E = m::E::Fn;
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}`
347
348error[E0618]: expected function, found enum variant `m::E::Unit`
349  --> $DIR/privacy-enum-ctor.rs:47:16
350   |
351LL |         Unit,
352   |         ---- `m::E::Unit` defined here
353...
354LL |     let _: E = m::E::Unit();
355   |                ^^^^^^^^^^--
356   |                |
357   |                call expression requires function
358   |
359help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
360   |
361LL |     let _: E = m::E::Unit;
362   |                ^^^^^^^^^^
363
364error[E0308]: mismatched types
365  --> $DIR/privacy-enum-ctor.rs:51:16
366   |
367LL |         Fn(u8),
368   |         ------ fn(u8) -> m::E {m::E::Fn} defined here
369...
370LL |     let _: E = E::Fn;
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}`
379
380error[E0618]: expected function, found enum variant `E::Unit`
381  --> $DIR/privacy-enum-ctor.rs:55:16
382   |
383LL |         Unit,
384   |         ---- `E::Unit` defined here
385...
386LL |     let _: E = E::Unit();
387   |                ^^^^^^^--
388   |                |
389   |                call expression requires function
390   |
391help: `E::Unit` is a unit variant, you need to write it without the parenthesis
392   |
393LL |     let _: E = E::Unit;
394   |                ^^^^^^^
395
396error: aborting due to 23 previous errors
397
398Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618.
399For more information about an error, try `rustc --explain E0308`.