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
4 LL | struct Struct5<T: ?Sized>{
5 | - this type parameter needs to be `std::marker::Sized`
7 | ^^^^ doesn't have a size known at compile-time
9 note: required by a bound in `X`
10 --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
13 | ^ required by this bound in `X`
14 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
15 --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
18 | ^ - ...if indirection were used here: `Box<T>`
20 | this could be changed to `T: ?Sized`...
21 help: consider removing the `?Sized` bound to make the type parameter `Sized`
23 LL - struct Struct5<T: ?Sized>{
24 LL + struct Struct5<T>{
27 error[E0277]: the size for values of type `Self` cannot be known at compilation time
28 --> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
30 LL | fn func1() -> Struct1<Self>;
31 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
33 note: required by a bound in `Struct1`
34 --> $DIR/adt-param-with-implicit-sized-bound.rs:8:16
36 LL | struct Struct1<T>{
37 | ^ required by this bound in `Struct1`
38 help: consider further restricting `Self`
40 LL | fn func1() -> Struct1<Self> where Self: Sized;
42 help: consider relaxing the implicit `Sized` restriction
44 LL | struct Struct1<T: ?Sized>{
47 error[E0277]: the size for values of type `Self` cannot be known at compilation time
48 --> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
50 LL | fn func2<'a>() -> Struct2<'a, Self>;
51 | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
53 note: required by a bound in `Struct2`
54 --> $DIR/adt-param-with-implicit-sized-bound.rs:11:20
56 LL | struct Struct2<'a, T>{
57 | ^ required by this bound in `Struct2`
58 help: consider further restricting `Self`
60 LL | fn func2<'a>() -> Struct2<'a, Self> where Self: Sized;
62 help: consider relaxing the implicit `Sized` restriction
64 LL | struct Struct2<'a, T: ?Sized>{
67 error[E0277]: the size for values of type `Self` cannot be known at compilation time
68 --> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
70 LL | fn func3() -> Struct3<Self>;
71 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
73 note: required by a bound in `Struct3`
74 --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
76 LL | struct Struct3<T>{
77 | ^ required by this bound in `Struct3`
78 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
79 --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
81 LL | struct Struct3<T>{
82 | ^ this could be changed to `T: ?Sized`...
84 | - ...if indirection were used here: `Box<T>`
85 help: consider further restricting `Self`
87 LL | fn func3() -> Struct3<Self> where Self: Sized;
90 error[E0277]: the size for values of type `Self` cannot be known at compilation time
91 --> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
93 LL | fn func4() -> Struct4<Self>;
94 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
96 note: required by a bound in `Struct4`
97 --> $DIR/adt-param-with-implicit-sized-bound.rs:20:16
99 LL | struct Struct4<T>{
100 | ^ required by this bound in `Struct4`
101 help: consider further restricting `Self`
103 LL | fn func4() -> Struct4<Self> where Self: Sized;
105 help: consider relaxing the implicit `Sized` restriction
107 LL | struct Struct4<T: ?Sized>{
110 error: aborting due to 5 previous errors
112 For more information about this error, try `rustc --explain E0277`.