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: the trait `std::marker::Sized` is not implemented for `T`
13 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
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 was used here: `Box<T>`
20 | this could be changed to `T: ?Sized`...
22 error[E0277]: the size for values of type `Self` cannot be known at compilation time
23 --> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
25 LL | fn func1() -> Struct1<Self>;
26 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
28 LL | struct Struct1<T>{
29 | - required by this bound in `Struct1`
31 = help: the trait `std::marker::Sized` is not implemented for `Self`
32 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
33 help: consider further restricting `Self`
35 LL | fn func1() -> Struct1<Self> where Self: std::marker::Sized;
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 help: consider relaxing the implicit `Sized` restriction
39 LL | struct Struct1<T: ?Sized>{
42 error[E0277]: the size for values of type `Self` cannot be known at compilation time
43 --> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
45 LL | fn func2<'a>() -> Struct2<'a, Self>;
46 | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
48 LL | struct Struct2<'a, T>{
49 | - required by this bound in `Struct2`
51 = help: the trait `std::marker::Sized` is not implemented for `Self`
52 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
53 help: consider further restricting `Self`
55 LL | fn func2<'a>() -> Struct2<'a, Self> where Self: std::marker::Sized;
56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 help: consider relaxing the implicit `Sized` restriction
59 LL | struct Struct2<'a, T: ?Sized>{
62 error[E0277]: the size for values of type `Self` cannot be known at compilation time
63 --> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
65 LL | fn func3() -> Struct3<Self>;
66 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
68 LL | struct Struct3<T>{
69 | - required by this bound in `Struct3`
71 = help: the trait `std::marker::Sized` is not implemented for `Self`
72 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
73 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
74 --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
76 LL | struct Struct3<T>{
77 | ^ this could be changed to `T: ?Sized`...
79 | - ...if indirection was used here: `Box<T>`
80 help: consider further restricting `Self`
82 LL | fn func3() -> Struct3<Self> where Self: std::marker::Sized;
83 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85 error[E0277]: the size for values of type `Self` cannot be known at compilation time
86 --> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
88 LL | fn func4() -> Struct4<Self>;
89 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
91 LL | struct Struct4<T>{
92 | - required by this bound in `Struct4`
94 = help: the trait `std::marker::Sized` is not implemented for `Self`
95 = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
96 help: consider further restricting `Self`
98 LL | fn func4() -> Struct4<Self> where Self: std::marker::Sized;
99 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 help: consider relaxing the implicit `Sized` restriction
102 LL | struct Struct4<T: ?Sized>{
105 error: aborting due to 5 previous errors
107 For more information about this error, try `rustc --explain E0277`.