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