]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0277]: the size for values of type `T` cannot be known at compilation time |
0731742a | 2 | --> $DIR/unsized-enum.rs:6:36 |
8faf50e0 | 3 | | |
b7449926 | 4 | LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() } |
74b04a01 | 5 | | - ^^^^^^ doesn't have a size known at compile-time |
e74abb32 | 6 | | | |
fe692bf9 | 7 | | this type parameter needs to be `Sized` |
8faf50e0 | 8 | | |
94222f64 XL |
9 | note: required by a bound in `Foo` |
10 | --> $DIR/unsized-enum.rs:4:10 | |
11 | | | |
12 | LL | enum Foo<U> { FooSome(U), FooNone } | |
13 | | ^ required by this bound in `Foo` | |
f035d41b XL |
14 | help: you could relax the implicit `Sized` bound on `U` if it were used through indirection like `&U` or `Box<U>` |
15 | --> $DIR/unsized-enum.rs:4:10 | |
16 | | | |
17 | LL | enum Foo<U> { FooSome(U), FooNone } | |
6a06907d | 18 | | ^ - ...if indirection were used here: `Box<U>` |
f035d41b XL |
19 | | | |
20 | | this could be changed to `U: ?Sized`... | |
94222f64 XL |
21 | help: consider removing the `?Sized` bound to make the type parameter `Sized` |
22 | | | |
23 | LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() } | |
24 | LL + fn foo2<T>() { not_sized::<Foo<T>>() } | |
923072b8 | 25 | | |
8faf50e0 | 26 | |
4b012472 | 27 | error: aborting due to 1 previous error |
8faf50e0 XL |
28 | |
29 | For more information about this error, try `rustc --explain E0277`. |