1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2 --> $DIR/unsized-struct.rs:6:36
4 LL | struct Foo<T> { data: T }
5 | - required by this bound in `Foo`
6 LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
7 LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
8 | - ^^^^^^ doesn't have a size known at compile-time
10 | this type parameter needs to be `Sized`
12 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
13 --> $DIR/unsized-struct.rs:4:12
15 LL | struct Foo<T> { data: T }
16 | ^ - ...if indirection was used here: `Box<T>`
18 | this could be changed to `T: ?Sized`...
20 error[E0277]: the size for values of type `T` cannot be known at compilation time
21 --> $DIR/unsized-struct.rs:13:24
23 LL | fn is_sized<T:Sized>() { }
24 | - required by this bound in `is_sized`
26 LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
27 | - ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
29 | this type parameter needs to be `Sized`
31 = note: required because it appears within the type `Bar<T>`
33 error: aborting due to 2 previous errors
35 For more information about this error, try `rustc --explain E0277`.