fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
9.7 KiB372 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   |                      ^
257
258error[E0603]: enum `Z` is private
259  --> $DIR/privacy-enum-ctor.rs:61:22
260   |
261LL |     let _: Z = m::n::Z::Fn;
262   |                      ^
263
264error[E0603]: enum `Z` is private
265  --> $DIR/privacy-enum-ctor.rs:64:22
266   |
267LL |     let _: Z = m::n::Z::Struct;
268   |                      ^
269
270error[E0603]: enum `Z` is private
271  --> $DIR/privacy-enum-ctor.rs:68:22
272   |
273LL |     let _: Z = m::n::Z::Unit {};
274   |                      ^
275
276error[E0308]: mismatched types
277  --> $DIR/privacy-enum-ctor.rs:27:20
278   |
279LL |             Fn(u8),
280   |             ------ fn(u8) -> m::n::Z {m::n::Z::Fn} defined here
281...
282LL |         let _: Z = Z::Fn;
283   |                    ^^^^^
284   |                    |
285   |                    expected enum `m::n::Z`, found fn item
286   |                    help: use parentheses to instantiate this tuple variant: `Z::Fn(_)`
287   |
288   = note: expected type `m::n::Z`
289              found type `fn(u8) -> m::n::Z {m::n::Z::Fn}`
290
291error[E0618]: expected function, found enum variant `Z::Unit`
292  --> $DIR/privacy-enum-ctor.rs:31:17
293   |
294LL |             Unit,
295   |             ---- `Z::Unit` defined here
296...
297LL |         let _ = Z::Unit();
298   |                 ^^^^^^^--
299   |                 |
300   |                 call expression requires function
301   |
302help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
303   |
304LL |         let _ = Z::Unit;
305   |                 ^^^^^^^
306
307error[E0308]: mismatched types
308  --> $DIR/privacy-enum-ctor.rs:43:16
309   |
310LL |         Fn(u8),
311   |         ------ fn(u8) -> m::E {m::E::Fn} defined here
312...
313LL |     let _: E = m::E::Fn;
314   |                ^^^^^^^^
315   |                |
316   |                expected enum `m::E`, found fn item
317   |                help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)`
318   |
319   = note: expected type `m::E`
320              found type `fn(u8) -> m::E {m::E::Fn}`
321
322error[E0618]: expected function, found enum variant `m::E::Unit`
323  --> $DIR/privacy-enum-ctor.rs:47:16
324   |
325LL |         Unit,
326   |         ---- `m::E::Unit` defined here
327...
328LL |     let _: E = m::E::Unit();
329   |                ^^^^^^^^^^--
330   |                |
331   |                call expression requires function
332   |
333help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
334   |
335LL |     let _: E = m::E::Unit;
336   |                ^^^^^^^^^^
337
338error[E0308]: mismatched types
339  --> $DIR/privacy-enum-ctor.rs:51:16
340   |
341LL |         Fn(u8),
342   |         ------ fn(u8) -> m::E {m::E::Fn} defined here
343...
344LL |     let _: E = E::Fn;
345   |                ^^^^^
346   |                |
347   |                expected enum `m::E`, found fn item
348   |                help: use parentheses to instantiate this tuple variant: `E::Fn(_)`
349   |
350   = note: expected type `m::E`
351              found type `fn(u8) -> m::E {m::E::Fn}`
352
353error[E0618]: expected function, found enum variant `E::Unit`
354  --> $DIR/privacy-enum-ctor.rs:55:16
355   |
356LL |         Unit,
357   |         ---- `E::Unit` defined here
358...
359LL |     let _: E = E::Unit();
360   |                ^^^^^^^--
361   |                |
362   |                call expression requires function
363   |
364help: `E::Unit` is a unit variant, you need to write it without the parenthesis
365   |
366LL |     let _: E = E::Unit;
367   |                ^^^^^^^
368
369error: aborting due to 23 previous errors
370
371Some errors have detailed explanations: E0308, E0412, E0423, E0603, E0618.
372For more information about an error, try `rustc --explain E0308`.