1 error[E0277]: the size for values of type `W` cannot be known at compilation time
2 --> $DIR/unsized-enum2.rs:23:8
4 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
5 | - this type parameter needs to be `std::marker::Sized`
8 | ^ doesn't have a size known at compile-time
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
12 help: consider removing the `?Sized` bound to make the type parameter `Sized`
14 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
15 LL + enum E<W, X: ?Sized, Y: ?Sized, Z: ?Sized> {
17 help: borrowed types always have a statically known size
21 help: the `Box` type always has a statically known size and allocates its contents in the heap
26 error[E0277]: the size for values of type `X` cannot be known at compilation time
27 --> $DIR/unsized-enum2.rs:25:11
29 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
30 | - this type parameter needs to be `std::marker::Sized`
33 | ^ doesn't have a size known at compile-time
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
37 help: consider removing the `?Sized` bound to make the type parameter `Sized`
39 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
40 LL + enum E<W: ?Sized, X, Y: ?Sized, Z: ?Sized> {
42 help: borrowed types always have a statically known size
46 help: the `Box` type always has a statically known size and allocates its contents in the heap
51 error[E0277]: the size for values of type `Y` cannot be known at compilation time
52 --> $DIR/unsized-enum2.rs:27:15
54 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
55 | - this type parameter needs to be `std::marker::Sized`
58 | ^ doesn't have a size known at compile-time
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
62 help: consider removing the `?Sized` bound to make the type parameter `Sized`
64 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
65 LL + enum E<W: ?Sized, X: ?Sized, Y, Z: ?Sized> {
67 help: borrowed types always have a statically known size
71 help: the `Box` type always has a statically known size and allocates its contents in the heap
73 LL | VC(isize, Box<Y>),
76 error[E0277]: the size for values of type `Z` cannot be known at compilation time
77 --> $DIR/unsized-enum2.rs:29:21
79 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
80 | - this type parameter needs to be `std::marker::Sized`
82 LL | VD{u: isize, x: Z},
83 | ^ doesn't have a size known at compile-time
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
87 help: consider removing the `?Sized` bound to make the type parameter `Sized`
89 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
90 LL + enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z> {
92 help: borrowed types always have a statically known size
94 LL | VD{u: isize, x: &Z},
96 help: the `Box` type always has a statically known size and allocates its contents in the heap
98 LL | VD{u: isize, x: Box<Z>},
101 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
102 --> $DIR/unsized-enum2.rs:33:8
105 | ^^^^ doesn't have a size known at compile-time
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
110 help: borrowed types always have a statically known size
114 help: the `Box` type always has a statically known size and allocates its contents in the heap
119 error[E0277]: the size for values of type `str` cannot be known at compilation time
120 --> $DIR/unsized-enum2.rs:35:11
123 | ^^^ doesn't have a size known at compile-time
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
128 help: borrowed types always have a statically known size
132 help: the `Box` type always has a statically known size and allocates its contents in the heap
134 LL | VF{x: Box<str>},
137 error[E0277]: the size for values of type `[f32]` cannot be known at compilation time
138 --> $DIR/unsized-enum2.rs:37:15
140 LL | VG(isize, [f32]),
141 | ^^^^^ doesn't have a size known at compile-time
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
146 help: borrowed types always have a statically known size
148 LL | VG(isize, &[f32]),
150 help: the `Box` type always has a statically known size and allocates its contents in the heap
152 LL | VG(isize, Box<[f32]>),
155 error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
156 --> $DIR/unsized-enum2.rs:39:21
158 LL | VH{u: isize, x: [u32]},
159 | ^^^^^ doesn't have a size known at compile-time
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
164 help: borrowed types always have a statically known size
166 LL | VH{u: isize, x: &[u32]},
168 help: the `Box` type always has a statically known size and allocates its contents in the heap
170 LL | VH{u: isize, x: Box<[u32]>},
173 error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
174 --> $DIR/unsized-enum2.rs:53:8
177 | ^^^^^^^ doesn't have a size known at compile-time
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
182 help: borrowed types always have a statically known size
186 help: the `Box` type always has a statically known size and allocates its contents in the heap
188 LL | VM(Box<dyn Foo>),
191 error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time
192 --> $DIR/unsized-enum2.rs:55:11
195 | ^^^^^^^ doesn't have a size known at compile-time
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
200 help: borrowed types always have a statically known size
202 LL | VN{x: &dyn Bar},
204 help: the `Box` type always has a statically known size and allocates its contents in the heap
206 LL | VN{x: Box<dyn Bar>},
209 error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time
210 --> $DIR/unsized-enum2.rs:57:15
212 LL | VO(isize, dyn FooBar),
213 | ^^^^^^^^^^ doesn't have a size known at compile-time
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
218 help: borrowed types always have a statically known size
220 LL | VO(isize, &dyn FooBar),
222 help: the `Box` type always has a statically known size and allocates its contents in the heap
224 LL | VO(isize, Box<dyn FooBar>),
227 error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time
228 --> $DIR/unsized-enum2.rs:59:21
230 LL | VP{u: isize, x: dyn BarFoo},
231 | ^^^^^^^^^^ doesn't have a size known at compile-time
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
236 help: borrowed types always have a statically known size
238 LL | VP{u: isize, x: &dyn BarFoo},
240 help: the `Box` type always has a statically known size and allocates its contents in the heap
242 LL | VP{u: isize, x: Box<dyn BarFoo>},
245 error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
246 --> $DIR/unsized-enum2.rs:63:8
248 LL | VQ(<&'static [i8] as Deref>::Target),
249 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
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
254 help: borrowed types always have a statically known size
256 LL | VQ(&<&'static [i8] as Deref>::Target),
258 help: the `Box` type always has a statically known size and allocates its contents in the heap
260 LL | VQ(Box<<&'static [i8] as Deref>::Target>),
263 error[E0277]: the size for values of type `[char]` cannot be known at compilation time
264 --> $DIR/unsized-enum2.rs:65:11
266 LL | VR{x: <&'static [char] as Deref>::Target},
267 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
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
272 help: borrowed types always have a statically known size
274 LL | VR{x: &<&'static [char] as Deref>::Target},
276 help: the `Box` type always has a statically known size and allocates its contents in the heap
278 LL | VR{x: Box<<&'static [char] as Deref>::Target>},
281 error[E0277]: the size for values of type `[f64]` cannot be known at compilation time
282 --> $DIR/unsized-enum2.rs:67:15
284 LL | VS(isize, <&'static [f64] as Deref>::Target),
285 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
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
290 help: borrowed types always have a statically known size
292 LL | VS(isize, &<&'static [f64] as Deref>::Target),
294 help: the `Box` type always has a statically known size and allocates its contents in the heap
296 LL | VS(isize, Box<<&'static [f64] as Deref>::Target>),
299 error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
300 --> $DIR/unsized-enum2.rs:69:21
302 LL | VT{u: isize, x: <&'static [i32] as Deref>::Target},
303 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
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
308 help: borrowed types always have a statically known size
310 LL | VT{u: isize, x: &<&'static [i32] as Deref>::Target},
312 help: the `Box` type always has a statically known size and allocates its contents in the heap
314 LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
317 error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time
318 --> $DIR/unsized-enum2.rs:43:8
321 | ^^^^^ doesn't have a size known at compile-time
323 = help: within `Path1`, the trait `Sized` is not implemented for `(dyn PathHelper1 + 'static)`
324 note: required because it appears within the type `Path1`
325 --> $DIR/unsized-enum2.rs:16:8
327 LL | struct Path1(dyn PathHelper1);
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
331 help: borrowed types always have a statically known size
335 help: the `Box` type always has a statically known size and allocates its contents in the heap
340 error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
341 --> $DIR/unsized-enum2.rs:45:11
344 | ^^^^^ doesn't have a size known at compile-time
346 = help: within `Path2`, the trait `Sized` is not implemented for `(dyn PathHelper2 + 'static)`
347 note: required because it appears within the type `Path2`
348 --> $DIR/unsized-enum2.rs:17:8
350 LL | struct Path2(dyn PathHelper2);
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
354 help: borrowed types always have a statically known size
358 help: the `Box` type always has a statically known size and allocates its contents in the heap
360 LL | VJ{x: Box<Path2>},
363 error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
364 --> $DIR/unsized-enum2.rs:47:15
366 LL | VK(isize, Path3),
367 | ^^^^^ doesn't have a size known at compile-time
369 = help: within `Path3`, the trait `Sized` is not implemented for `(dyn PathHelper3 + 'static)`
370 note: required because it appears within the type `Path3`
371 --> $DIR/unsized-enum2.rs:18:8
373 LL | struct Path3(dyn PathHelper3);
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
377 help: borrowed types always have a statically known size
379 LL | VK(isize, &Path3),
381 help: the `Box` type always has a statically known size and allocates its contents in the heap
383 LL | VK(isize, Box<Path3>),
386 error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time
387 --> $DIR/unsized-enum2.rs:49:21
389 LL | VL{u: isize, x: Path4},
390 | ^^^^^ doesn't have a size known at compile-time
392 = help: within `Path4`, the trait `Sized` is not implemented for `(dyn PathHelper4 + 'static)`
393 note: required because it appears within the type `Path4`
394 --> $DIR/unsized-enum2.rs:19:8
396 LL | struct Path4(dyn PathHelper4);
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
400 help: borrowed types always have a statically known size
402 LL | VL{u: isize, x: &Path4},
404 help: the `Box` type always has a statically known size and allocates its contents in the heap
406 LL | VL{u: isize, x: Box<Path4>},
409 error: aborting due to 20 previous errors
411 For more information about this error, try `rustc --explain E0277`.