]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized-enum2.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / unsized / unsized-enum2.stderr
1 error[E0277]: the size for values of type `W` cannot be known at compilation time
2   --> $DIR/unsized-enum2.rs:23:8
3    |
4 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
5    |        - this type parameter needs to be `std::marker::Sized`
6 LL |     // parameter
7 LL |     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
12 help: consider removing the `?Sized` bound to make the type parameter `Sized`
13    |
14 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
15 LL + enum E<W, X: ?Sized, Y: ?Sized, Z: ?Sized> {
16    |
17 help: borrowed types always have a statically known size
18    |
19 LL |     VA(&W),
20    |        +
21 help: the `Box` type always has a statically known size and allocates its contents in the heap
22    |
23 LL |     VA(Box<W>),
24    |        ++++ +
25
26 error[E0277]: the size for values of type `X` cannot be known at compilation time
27   --> $DIR/unsized-enum2.rs:25:11
28    |
29 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
30    |                   - this type parameter needs to be `std::marker::Sized`
31 ...
32 LL |     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
37 help: consider removing the `?Sized` bound to make the type parameter `Sized`
38    |
39 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
40 LL + enum E<W: ?Sized, X, Y: ?Sized, Z: ?Sized> {
41    |
42 help: borrowed types always have a statically known size
43    |
44 LL |     VB{x: &X},
45    |           +
46 help: the `Box` type always has a statically known size and allocates its contents in the heap
47    |
48 LL |     VB{x: Box<X>},
49    |           ++++ +
50
51 error[E0277]: the size for values of type `Y` cannot be known at compilation time
52   --> $DIR/unsized-enum2.rs:27:15
53    |
54 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
55    |                              - this type parameter needs to be `std::marker::Sized`
56 ...
57 LL |     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
62 help: consider removing the `?Sized` bound to make the type parameter `Sized`
63    |
64 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
65 LL + enum E<W: ?Sized, X: ?Sized, Y, Z: ?Sized> {
66    |
67 help: borrowed types always have a statically known size
68    |
69 LL |     VC(isize, &Y),
70    |               +
71 help: the `Box` type always has a statically known size and allocates its contents in the heap
72    |
73 LL |     VC(isize, Box<Y>),
74    |               ++++ +
75
76 error[E0277]: the size for values of type `Z` cannot be known at compilation time
77   --> $DIR/unsized-enum2.rs:29:21
78    |
79 LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
80    |                                         - this type parameter needs to be `std::marker::Sized`
81 ...
82 LL |     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
87 help: consider removing the `?Sized` bound to make the type parameter `Sized`
88    |
89 LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
90 LL + enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z> {
91    |
92 help: borrowed types always have a statically known size
93    |
94 LL |     VD{u: isize, x: &Z},
95    |                     +
96 help: the `Box` type always has a statically known size and allocates its contents in the heap
97    |
98 LL |     VD{u: isize, x: Box<Z>},
99    |                     ++++ +
100
101 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
102   --> $DIR/unsized-enum2.rs:33:8
103    |
104 LL |     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
110 help: borrowed types always have a statically known size
111    |
112 LL |     VE(&[u8]),
113    |        +
114 help: the `Box` type always has a statically known size and allocates its contents in the heap
115    |
116 LL |     VE(Box<[u8]>),
117    |        ++++    +
118
119 error[E0277]: the size for values of type `str` cannot be known at compilation time
120   --> $DIR/unsized-enum2.rs:35:11
121    |
122 LL |     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
128 help: borrowed types always have a statically known size
129    |
130 LL |     VF{x: &str},
131    |           +
132 help: the `Box` type always has a statically known size and allocates its contents in the heap
133    |
134 LL |     VF{x: Box<str>},
135    |           ++++   +
136
137 error[E0277]: the size for values of type `[f32]` cannot be known at compilation time
138   --> $DIR/unsized-enum2.rs:37:15
139    |
140 LL |     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
146 help: borrowed types always have a statically known size
147    |
148 LL |     VG(isize, &[f32]),
149    |               +
150 help: the `Box` type always has a statically known size and allocates its contents in the heap
151    |
152 LL |     VG(isize, Box<[f32]>),
153    |               ++++     +
154
155 error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
156   --> $DIR/unsized-enum2.rs:39:21
157    |
158 LL |     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
164 help: borrowed types always have a statically known size
165    |
166 LL |     VH{u: isize, x: &[u32]},
167    |                     +
168 help: the `Box` type always has a statically known size and allocates its contents in the heap
169    |
170 LL |     VH{u: isize, x: Box<[u32]>},
171    |                     ++++     +
172
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
175    |
176 LL |     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
182 help: borrowed types always have a statically known size
183    |
184 LL |     VM(&dyn Foo),
185    |        +
186 help: the `Box` type always has a statically known size and allocates its contents in the heap
187    |
188 LL |     VM(Box<dyn Foo>),
189    |        ++++       +
190
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
193    |
194 LL |     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
200 help: borrowed types always have a statically known size
201    |
202 LL |     VN{x: &dyn Bar},
203    |           +
204 help: the `Box` type always has a statically known size and allocates its contents in the heap
205    |
206 LL |     VN{x: Box<dyn Bar>},
207    |           ++++       +
208
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
211    |
212 LL |     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
218 help: borrowed types always have a statically known size
219    |
220 LL |     VO(isize, &dyn FooBar),
221    |               +
222 help: the `Box` type always has a statically known size and allocates its contents in the heap
223    |
224 LL |     VO(isize, Box<dyn FooBar>),
225    |               ++++          +
226
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
229    |
230 LL |     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
236 help: borrowed types always have a statically known size
237    |
238 LL |     VP{u: isize, x: &dyn BarFoo},
239    |                     +
240 help: the `Box` type always has a statically known size and allocates its contents in the heap
241    |
242 LL |     VP{u: isize, x: Box<dyn BarFoo>},
243    |                     ++++          +
244
245 error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
246   --> $DIR/unsized-enum2.rs:63:8
247    |
248 LL |     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
254 help: borrowed types always have a statically known size
255    |
256 LL |     VQ(&<&'static [i8] as Deref>::Target),
257    |        +
258 help: the `Box` type always has a statically known size and allocates its contents in the heap
259    |
260 LL |     VQ(Box<<&'static [i8] as Deref>::Target>),
261    |        ++++                                +
262
263 error[E0277]: the size for values of type `[char]` cannot be known at compilation time
264   --> $DIR/unsized-enum2.rs:65:11
265    |
266 LL |     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
272 help: borrowed types always have a statically known size
273    |
274 LL |     VR{x: &<&'static [char] as Deref>::Target},
275    |           +
276 help: the `Box` type always has a statically known size and allocates its contents in the heap
277    |
278 LL |     VR{x: Box<<&'static [char] as Deref>::Target>},
279    |           ++++                                  +
280
281 error[E0277]: the size for values of type `[f64]` cannot be known at compilation time
282   --> $DIR/unsized-enum2.rs:67:15
283    |
284 LL |     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
290 help: borrowed types always have a statically known size
291    |
292 LL |     VS(isize, &<&'static [f64] as Deref>::Target),
293    |               +
294 help: the `Box` type always has a statically known size and allocates its contents in the heap
295    |
296 LL |     VS(isize, Box<<&'static [f64] as Deref>::Target>),
297    |               ++++                                 +
298
299 error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
300   --> $DIR/unsized-enum2.rs:69:21
301    |
302 LL |     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
308 help: borrowed types always have a statically known size
309    |
310 LL |     VT{u: isize, x: &<&'static [i32] as Deref>::Target},
311    |                     +
312 help: the `Box` type always has a statically known size and allocates its contents in the heap
313    |
314 LL |     VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
315    |                     ++++                                 +
316
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
319    |
320 LL |     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)`
324 note: required because it appears within the type `Path1`
325   --> $DIR/unsized-enum2.rs:16:8
326    |
327 LL | 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
331 help: borrowed types always have a statically known size
332    |
333 LL |     VI(&Path1),
334    |        +
335 help: the `Box` type always has a statically known size and allocates its contents in the heap
336    |
337 LL |     VI(Box<Path1>),
338    |        ++++     +
339
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
342    |
343 LL |     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)`
347 note: required because it appears within the type `Path2`
348   --> $DIR/unsized-enum2.rs:17:8
349    |
350 LL | 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
354 help: borrowed types always have a statically known size
355    |
356 LL |     VJ{x: &Path2},
357    |           +
358 help: the `Box` type always has a statically known size and allocates its contents in the heap
359    |
360 LL |     VJ{x: Box<Path2>},
361    |           ++++     +
362
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
365    |
366 LL |     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)`
370 note: required because it appears within the type `Path3`
371   --> $DIR/unsized-enum2.rs:18:8
372    |
373 LL | 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
377 help: borrowed types always have a statically known size
378    |
379 LL |     VK(isize, &Path3),
380    |               +
381 help: the `Box` type always has a statically known size and allocates its contents in the heap
382    |
383 LL |     VK(isize, Box<Path3>),
384    |               ++++     +
385
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
388    |
389 LL |     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)`
393 note: required because it appears within the type `Path4`
394   --> $DIR/unsized-enum2.rs:19:8
395    |
396 LL | 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
400 help: borrowed types always have a statically known size
401    |
402 LL |     VL{u: isize, x: &Path4},
403    |                     +
404 help: the `Box` type always has a statically known size and allocates its contents in the heap
405    |
406 LL |     VL{u: isize, x: Box<Path4>},
407    |                     ++++     +
408
409 error: aborting due to 20 previous errors
410
411 For more information about this error, try `rustc --explain E0277`.