1 error[E0277]: the size for values of type `X` cannot be known at compilation time
2 --> $DIR/unsized3.rs:7:13
4 LL | fn f1<X: ?Sized>(x: &X) {
5 | - this type parameter needs to be `std::marker::Sized`
7 | ------- ^ doesn't have a size known at compile-time
9 | required by a bound introduced by this call
11 note: required by a bound in `f2`
12 --> $DIR/unsized3.rs:10:7
14 LL | fn f2<X>(x: &X) {
15 | ^ required by this bound in `f2`
16 help: consider removing the `?Sized` bound to make the type parameter `Sized`
18 LL - fn f1<X: ?Sized>(x: &X) {
19 LL + fn f1<X>(x: &X) {
21 help: consider relaxing the implicit `Sized` restriction
23 LL | fn f2<X: ?Sized>(x: &X) {
26 error[E0277]: the size for values of type `X` cannot be known at compilation time
27 --> $DIR/unsized3.rs:18:13
29 LL | fn f3<X: ?Sized + T>(x: &X) {
30 | - this type parameter needs to be `std::marker::Sized`
32 | ------- ^ doesn't have a size known at compile-time
34 | required by a bound introduced by this call
36 note: required by a bound in `f4`
37 --> $DIR/unsized3.rs:21:7
39 LL | fn f4<X: T>(x: &X) {
40 | ^ required by this bound in `f4`
41 help: consider removing the `?Sized` bound to make the type parameter `Sized`
43 LL - fn f3<X: ?Sized + T>(x: &X) {
44 LL + fn f3<X: T>(x: &X) {
46 help: consider relaxing the implicit `Sized` restriction
48 LL | fn f4<X: T + ?Sized>(x: &X) {
51 error[E0277]: the size for values of type `X` cannot be known at compilation time
52 --> $DIR/unsized3.rs:33:8
54 LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
55 | - this type parameter needs to be `std::marker::Sized`
57 | -- ^^ doesn't have a size known at compile-time
59 | required by a bound introduced by this call
61 note: required because it appears within the type `S<X>`
62 --> $DIR/unsized3.rs:28:8
64 LL | struct S<X: ?Sized> {
66 note: required by a bound in `f5`
67 --> $DIR/unsized3.rs:24:7
69 LL | fn f5<Y>(x: &Y) {}
70 | ^ required by this bound in `f5`
71 help: consider removing the `?Sized` bound to make the type parameter `Sized`
73 LL - fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
74 LL + fn f8<X>(x1: &S<X>, x2: &S<X>) {
76 help: consider relaxing the implicit `Sized` restriction
78 LL | fn f5<Y: ?Sized>(x: &Y) {}
81 error[E0277]: the size for values of type `X` cannot be known at compilation time
82 --> $DIR/unsized3.rs:40:5
84 LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
85 | - this type parameter needs to be `std::marker::Sized`
87 | ^^ doesn't have a size known at compile-time
89 note: required because it appears within the type `S<X>`
90 --> $DIR/unsized3.rs:28:8
92 LL | struct S<X: ?Sized> {
94 = note: only the last element of a tuple may have a dynamically sized type
95 help: consider removing the `?Sized` bound to make the type parameter `Sized`
97 LL - fn f9<X: ?Sized>(x1: Box<S<X>>) {
98 LL + fn f9<X>(x1: Box<S<X>>) {
101 error[E0277]: the size for values of type `X` cannot be known at compilation time
102 --> $DIR/unsized3.rs:45:9
104 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
105 | - this type parameter needs to be `std::marker::Sized`
107 | ^^^^^^^^^ doesn't have a size known at compile-time
109 note: required because it appears within the type `S<X>`
110 --> $DIR/unsized3.rs:28:8
112 LL | struct S<X: ?Sized> {
114 = note: required because it appears within the type `({integer}, S<X>)`
115 = note: tuples must have a statically known size to be initialized
116 help: consider removing the `?Sized` bound to make the type parameter `Sized`
118 LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
119 LL + fn f10<X>(x1: Box<S<X>>) {
122 error[E0277]: the size for values of type `X` cannot be known at compilation time
123 --> $DIR/unsized3.rs:45:8
125 LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
126 | - this type parameter needs to be `std::marker::Sized`
128 | -- ^^^^^^^^^^ doesn't have a size known at compile-time
130 | required by a bound introduced by this call
132 note: required because it appears within the type `S<X>`
133 --> $DIR/unsized3.rs:28:8
135 LL | struct S<X: ?Sized> {
137 = note: required because it appears within the type `({integer}, S<X>)`
138 note: required by a bound in `f5`
139 --> $DIR/unsized3.rs:24:7
141 LL | fn f5<Y>(x: &Y) {}
142 | ^ required by this bound in `f5`
143 help: consider removing the `?Sized` bound to make the type parameter `Sized`
145 LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
146 LL + fn f10<X>(x1: Box<S<X>>) {
148 help: consider relaxing the implicit `Sized` restriction
150 LL | fn f5<Y: ?Sized>(x: &Y) {}
153 error: aborting due to 6 previous errors
155 For more information about this error, try `rustc --explain E0277`.