1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2 --> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
5 | - required by this bound in `X`
7 LL | struct Struct5<T: ?Sized>{
8 | - this type parameter needs to be `std::marker::Sized`
10 | ^^^^ doesn't have a size known at compile-time
12 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
13 --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
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 `Self` cannot be known at compilation time
21 --> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
23 LL | fn func1() -> Struct1<Self>;
24 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
26 LL | struct Struct1<T>{
27 | - required by this bound in `Struct1`
29 help: consider further restricting `Self`
31 LL | fn func1() -> Struct1<Self> where Self: std::marker::Sized;
32 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33 help: consider relaxing the implicit `Sized` restriction
35 LL | struct Struct1<T: ?Sized>{
38 error[E0277]: the size for values of type `Self` cannot be known at compilation time
39 --> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
41 LL | fn func2<'a>() -> Struct2<'a, Self>;
42 | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
44 LL | struct Struct2<'a, T>{
45 | - required by this bound in `Struct2`
47 help: consider further restricting `Self`
49 LL | fn func2<'a>() -> Struct2<'a, Self> where Self: std::marker::Sized;
50 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51 help: consider relaxing the implicit `Sized` restriction
53 LL | struct Struct2<'a, T: ?Sized>{
56 error[E0277]: the size for values of type `Self` cannot be known at compilation time
57 --> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
59 LL | fn func3() -> Struct3<Self>;
60 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
62 LL | struct Struct3<T>{
63 | - required by this bound in `Struct3`
65 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
66 --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
68 LL | struct Struct3<T>{
69 | ^ this could be changed to `T: ?Sized`...
71 | - ...if indirection was used here: `Box<T>`
72 help: consider further restricting `Self`
74 LL | fn func3() -> Struct3<Self> where Self: std::marker::Sized;
75 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77 error[E0277]: the size for values of type `Self` cannot be known at compilation time
78 --> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
80 LL | fn func4() -> Struct4<Self>;
81 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
83 LL | struct Struct4<T>{
84 | - required by this bound in `Struct4`
86 help: consider further restricting `Self`
88 LL | fn func4() -> Struct4<Self> where Self: std::marker::Sized;
89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90 help: consider relaxing the implicit `Sized` restriction
92 LL | struct Struct4<T: ?Sized>{
95 error: aborting due to 5 previous errors
97 For more information about this error, try `rustc --explain E0277`.