fork/rust

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

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

master
16.1 KiB411 linesraw
1error[E0277]: the size for values of type `W` cannot be known at compilation time
2  --> $DIR/unsized-enum2.rs:23:8
3   |
4LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
5   |        - this type parameter needs to be `Sized`
6LL |     // parameter
7LL |     VA(W),
8   |        ^ doesn't have a size known at compile-time
9   |
10   = note: no field of an enum variant may have a dynamically sized type
11   = help: change the field's type to have a statically known size
12help: consider removing the `?Sized` bound to make the type parameter `Sized`
13   |
14LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
15LL + enum E<W, X: ?Sized, Y: ?Sized, Z: ?Sized> {
16   |
17help: borrowed types always have a statically known size
18   |
19LL |     VA(&W),
20   |        +
21help: the `Box` type always has a statically known size and allocates its contents in the heap
22   |
23LL |     VA(Box<W>),
24   |        ++++ +
25
26error[E0277]: the size for values of type `X` cannot be known at compilation time
27  --> $DIR/unsized-enum2.rs:25:11
28   |
29LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
30   |                   - this type parameter needs to be `Sized`
31...
32LL |     VB{x: X},
33   |           ^ doesn't have a size known at compile-time
34   |
35   = note: no field of an enum variant may have a dynamically sized type
36   = help: change the field's type to have a statically known size
37help: consider removing the `?Sized` bound to make the type parameter `Sized`
38   |
39LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
40LL + enum E<W: ?Sized, X, Y: ?Sized, Z: ?Sized> {
41   |
42help: borrowed types always have a statically known size
43   |
44LL |     VB{x: &X},
45   |           +
46help: the `Box` type always has a statically known size and allocates its contents in the heap
47   |
48LL |     VB{x: Box<X>},
49   |           ++++ +
50
51error[E0277]: the size for values of type `Y` cannot be known at compilation time
52  --> $DIR/unsized-enum2.rs:27:15
53   |
54LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
55   |                              - this type parameter needs to be `Sized`
56...
57LL |     VC(isize, Y),
58   |               ^ doesn't have a size known at compile-time
59   |
60   = note: no field of an enum variant may have a dynamically sized type
61   = help: change the field's type to have a statically known size
62help: consider removing the `?Sized` bound to make the type parameter `Sized`
63   |
64LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
65LL + enum E<W: ?Sized, X: ?Sized, Y, Z: ?Sized> {
66   |
67help: borrowed types always have a statically known size
68   |
69LL |     VC(isize, &Y),
70   |               +
71help: the `Box` type always has a statically known size and allocates its contents in the heap
72   |
73LL |     VC(isize, Box<Y>),
74   |               ++++ +
75
76error[E0277]: the size for values of type `Z` cannot be known at compilation time
77  --> $DIR/unsized-enum2.rs:29:21
78   |
79LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
80   |                                         - this type parameter needs to be `Sized`
81...
82LL |     VD{u: isize, x: Z},
83   |                     ^ doesn't have a size known at compile-time
84   |
85   = note: no field of an enum variant may have a dynamically sized type
86   = help: change the field's type to have a statically known size
87help: consider removing the `?Sized` bound to make the type parameter `Sized`
88   |
89LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
90LL + enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z> {
91   |
92help: borrowed types always have a statically known size
93   |
94LL |     VD{u: isize, x: &Z},
95   |                     +
96help: the `Box` type always has a statically known size and allocates its contents in the heap
97   |
98LL |     VD{u: isize, x: Box<Z>},
99   |                     ++++ +
100
101error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
102  --> $DIR/unsized-enum2.rs:33:8
103   |
104LL |     VE([u8]),
105   |        ^^^^ doesn't have a size known at compile-time
106   |
107   = help: the trait `Sized` is not implemented for `[u8]`
108   = note: no field of an enum variant may have a dynamically sized type
109   = help: change the field's type to have a statically known size
110help: borrowed types always have a statically known size
111   |
112LL |     VE(&[u8]),
113   |        +
114help: the `Box` type always has a statically known size and allocates its contents in the heap
115   |
116LL |     VE(Box<[u8]>),
117   |        ++++    +
118
119error[E0277]: the size for values of type `str` cannot be known at compilation time
120  --> $DIR/unsized-enum2.rs:35:11
121   |
122LL |     VF{x: str},
123   |           ^^^ doesn't have a size known at compile-time
124   |
125   = help: the trait `Sized` is not implemented for `str`
126   = note: no field of an enum variant may have a dynamically sized type
127   = help: change the field's type to have a statically known size
128help: borrowed types always have a statically known size
129   |
130LL |     VF{x: &str},
131   |           +
132help: the `Box` type always has a statically known size and allocates its contents in the heap
133   |
134LL |     VF{x: Box<str>},
135   |           ++++   +
136
137error[E0277]: the size for values of type `[f32]` cannot be known at compilation time
138  --> $DIR/unsized-enum2.rs:37:15
139   |
140LL |     VG(isize, [f32]),
141   |               ^^^^^ doesn't have a size known at compile-time
142   |
143   = help: the trait `Sized` is not implemented for `[f32]`
144   = note: no field of an enum variant may have a dynamically sized type
145   = help: change the field's type to have a statically known size
146help: borrowed types always have a statically known size
147   |
148LL |     VG(isize, &[f32]),
149   |               +
150help: the `Box` type always has a statically known size and allocates its contents in the heap
151   |
152LL |     VG(isize, Box<[f32]>),
153   |               ++++     +
154
155error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
156  --> $DIR/unsized-enum2.rs:39:21
157   |
158LL |     VH{u: isize, x: [u32]},
159   |                     ^^^^^ doesn't have a size known at compile-time
160   |
161   = help: the trait `Sized` is not implemented for `[u32]`
162   = note: no field of an enum variant may have a dynamically sized type
163   = help: change the field's type to have a statically known size
164help: borrowed types always have a statically known size
165   |
166LL |     VH{u: isize, x: &[u32]},
167   |                     +
168help: the `Box` type always has a statically known size and allocates its contents in the heap
169   |
170LL |     VH{u: isize, x: Box<[u32]>},
171   |                     ++++     +
172
173error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
174  --> $DIR/unsized-enum2.rs:53:8
175   |
176LL |     VM(dyn Foo),
177   |        ^^^^^^^ doesn't have a size known at compile-time
178   |
179   = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
180   = note: no field of an enum variant may have a dynamically sized type
181   = help: change the field's type to have a statically known size
182help: borrowed types always have a statically known size
183   |
184LL |     VM(&dyn Foo),
185   |        +
186help: the `Box` type always has a statically known size and allocates its contents in the heap
187   |
188LL |     VM(Box<dyn Foo>),
189   |        ++++       +
190
191error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time
192  --> $DIR/unsized-enum2.rs:55:11
193   |
194LL |     VN{x: dyn Bar},
195   |           ^^^^^^^ doesn't have a size known at compile-time
196   |
197   = help: the trait `Sized` is not implemented for `(dyn Bar + 'static)`
198   = note: no field of an enum variant may have a dynamically sized type
199   = help: change the field's type to have a statically known size
200help: borrowed types always have a statically known size
201   |
202LL |     VN{x: &dyn Bar},
203   |           +
204help: the `Box` type always has a statically known size and allocates its contents in the heap
205   |
206LL |     VN{x: Box<dyn Bar>},
207   |           ++++       +
208
209error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time
210  --> $DIR/unsized-enum2.rs:57:15
211   |
212LL |     VO(isize, dyn FooBar),
213   |               ^^^^^^^^^^ doesn't have a size known at compile-time
214   |
215   = help: the trait `Sized` is not implemented for `(dyn FooBar + 'static)`
216   = note: no field of an enum variant may have a dynamically sized type
217   = help: change the field's type to have a statically known size
218help: borrowed types always have a statically known size
219   |
220LL |     VO(isize, &dyn FooBar),
221   |               +
222help: the `Box` type always has a statically known size and allocates its contents in the heap
223   |
224LL |     VO(isize, Box<dyn FooBar>),
225   |               ++++          +
226
227error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time
228  --> $DIR/unsized-enum2.rs:59:21
229   |
230LL |     VP{u: isize, x: dyn BarFoo},
231   |                     ^^^^^^^^^^ doesn't have a size known at compile-time
232   |
233   = help: the trait `Sized` is not implemented for `(dyn BarFoo + 'static)`
234   = note: no field of an enum variant may have a dynamically sized type
235   = help: change the field's type to have a statically known size
236help: borrowed types always have a statically known size
237   |
238LL |     VP{u: isize, x: &dyn BarFoo},
239   |                     +
240help: the `Box` type always has a statically known size and allocates its contents in the heap
241   |
242LL |     VP{u: isize, x: Box<dyn BarFoo>},
243   |                     ++++          +
244
245error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
246  --> $DIR/unsized-enum2.rs:63:8
247   |
248LL |     VQ(<&'static [i8] as Deref>::Target),
249   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
250   |
251   = help: the trait `Sized` is not implemented for `[i8]`
252   = note: no field of an enum variant may have a dynamically sized type
253   = help: change the field's type to have a statically known size
254help: borrowed types always have a statically known size
255   |
256LL |     VQ(&<&'static [i8] as Deref>::Target),
257   |        +
258help: the `Box` type always has a statically known size and allocates its contents in the heap
259   |
260LL |     VQ(Box<<&'static [i8] as Deref>::Target>),
261   |        ++++                                +
262
263error[E0277]: the size for values of type `[char]` cannot be known at compilation time
264  --> $DIR/unsized-enum2.rs:65:11
265   |
266LL |     VR{x: <&'static [char] as Deref>::Target},
267   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
268   |
269   = help: the trait `Sized` is not implemented for `[char]`
270   = note: no field of an enum variant may have a dynamically sized type
271   = help: change the field's type to have a statically known size
272help: borrowed types always have a statically known size
273   |
274LL |     VR{x: &<&'static [char] as Deref>::Target},
275   |           +
276help: the `Box` type always has a statically known size and allocates its contents in the heap
277   |
278LL |     VR{x: Box<<&'static [char] as Deref>::Target>},
279   |           ++++                                  +
280
281error[E0277]: the size for values of type `[f64]` cannot be known at compilation time
282  --> $DIR/unsized-enum2.rs:67:15
283   |
284LL |     VS(isize, <&'static [f64] as Deref>::Target),
285   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
286   |
287   = help: the trait `Sized` is not implemented for `[f64]`
288   = note: no field of an enum variant may have a dynamically sized type
289   = help: change the field's type to have a statically known size
290help: borrowed types always have a statically known size
291   |
292LL |     VS(isize, &<&'static [f64] as Deref>::Target),
293   |               +
294help: the `Box` type always has a statically known size and allocates its contents in the heap
295   |
296LL |     VS(isize, Box<<&'static [f64] as Deref>::Target>),
297   |               ++++                                 +
298
299error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
300  --> $DIR/unsized-enum2.rs:69:21
301   |
302LL |     VT{u: isize, x: <&'static [i32] as Deref>::Target},
303   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
304   |
305   = help: the trait `Sized` is not implemented for `[i32]`
306   = note: no field of an enum variant may have a dynamically sized type
307   = help: change the field's type to have a statically known size
308help: borrowed types always have a statically known size
309   |
310LL |     VT{u: isize, x: &<&'static [i32] as Deref>::Target},
311   |                     +
312help: the `Box` type always has a statically known size and allocates its contents in the heap
313   |
314LL |     VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
315   |                     ++++                                 +
316
317error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time
318  --> $DIR/unsized-enum2.rs:43:8
319   |
320LL |     VI(Path1),
321   |        ^^^^^ doesn't have a size known at compile-time
322   |
323   = help: within `Path1`, the trait `Sized` is not implemented for `(dyn PathHelper1 + 'static)`
324note: required because it appears within the type `Path1`
325  --> $DIR/unsized-enum2.rs:16:8
326   |
327LL | struct Path1(dyn PathHelper1);
328   |        ^^^^^
329   = note: no field of an enum variant may have a dynamically sized type
330   = help: change the field's type to have a statically known size
331help: borrowed types always have a statically known size
332   |
333LL |     VI(&Path1),
334   |        +
335help: the `Box` type always has a statically known size and allocates its contents in the heap
336   |
337LL |     VI(Box<Path1>),
338   |        ++++     +
339
340error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
341  --> $DIR/unsized-enum2.rs:45:11
342   |
343LL |     VJ{x: Path2},
344   |           ^^^^^ doesn't have a size known at compile-time
345   |
346   = help: within `Path2`, the trait `Sized` is not implemented for `(dyn PathHelper2 + 'static)`
347note: required because it appears within the type `Path2`
348  --> $DIR/unsized-enum2.rs:17:8
349   |
350LL | struct Path2(dyn PathHelper2);
351   |        ^^^^^
352   = note: no field of an enum variant may have a dynamically sized type
353   = help: change the field's type to have a statically known size
354help: borrowed types always have a statically known size
355   |
356LL |     VJ{x: &Path2},
357   |           +
358help: the `Box` type always has a statically known size and allocates its contents in the heap
359   |
360LL |     VJ{x: Box<Path2>},
361   |           ++++     +
362
363error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
364  --> $DIR/unsized-enum2.rs:47:15
365   |
366LL |     VK(isize, Path3),
367   |               ^^^^^ doesn't have a size known at compile-time
368   |
369   = help: within `Path3`, the trait `Sized` is not implemented for `(dyn PathHelper3 + 'static)`
370note: required because it appears within the type `Path3`
371  --> $DIR/unsized-enum2.rs:18:8
372   |
373LL | struct Path3(dyn PathHelper3);
374   |        ^^^^^
375   = note: no field of an enum variant may have a dynamically sized type
376   = help: change the field's type to have a statically known size
377help: borrowed types always have a statically known size
378   |
379LL |     VK(isize, &Path3),
380   |               +
381help: the `Box` type always has a statically known size and allocates its contents in the heap
382   |
383LL |     VK(isize, Box<Path3>),
384   |               ++++     +
385
386error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time
387  --> $DIR/unsized-enum2.rs:49:21
388   |
389LL |     VL{u: isize, x: Path4},
390   |                     ^^^^^ doesn't have a size known at compile-time
391   |
392   = help: within `Path4`, the trait `Sized` is not implemented for `(dyn PathHelper4 + 'static)`
393note: required because it appears within the type `Path4`
394  --> $DIR/unsized-enum2.rs:19:8
395   |
396LL | struct Path4(dyn PathHelper4);
397   |        ^^^^^
398   = note: no field of an enum variant may have a dynamically sized type
399   = help: change the field's type to have a statically known size
400help: borrowed types always have a statically known size
401   |
402LL |     VL{u: isize, x: &Path4},
403   |                     +
404help: the `Box` type always has a statically known size and allocates its contents in the heap
405   |
406LL |     VL{u: isize, x: Box<Path4>},
407   |                     ++++     +
408
409error: aborting due to 20 previous errors
410
411For more information about this error, try `rustc --explain E0277`.