1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2 --> $DIR/unsized-enum.rs:6:36
4 LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
5 | - ^^^^^^ doesn't have a size known at compile-time
7 | this type parameter needs to be `std::marker::Sized`
9 note: required by a bound in `Foo`
10 --> $DIR/unsized-enum.rs:4:10
12 LL | enum Foo<U> { FooSome(U), FooNone }
13 | ^ required by this bound in `Foo`
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
17 LL | enum Foo<U> { FooSome(U), FooNone }
18 | ^ - ...if indirection were used here: `Box<U>`
20 | this could be changed to `U: ?Sized`...
21 help: consider removing the `?Sized` bound to make the type parameter `Sized`
23 LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
24 LL + fn foo2<T>() { not_sized::<Foo<T>>() }
27 error: aborting due to previous error
29 For more information about this error, try `rustc --explain E0277`.