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