1 error[E0277]: the size for values of type `Y` cannot be known at compilation time
2 --> $DIR/unsized6.rs:9:9
4 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
5 | - this type parameter needs to be `std::marker::Sized`
8 | ^ doesn't have a size known at compile-time
10 = note: all local variables must have a statically known size
11 = help: unsized locals are gated as an unstable feature
12 help: consider removing the `?Sized` bound to make the type parameter `Sized`
14 LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
15 LL + fn f1<W: ?Sized, X: ?Sized, Y, Z: ?Sized>(x: &X) {
18 error[E0277]: the size for values of type `X` cannot be known at compilation time
19 --> $DIR/unsized6.rs:7:12
21 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
22 | - this type parameter needs to be `std::marker::Sized`
23 LL | let _: W; // <-- this is OK, no bindings created, no initializer.
24 LL | let _: (isize, (X, isize));
25 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
27 = note: only the last element of a tuple may have a dynamically sized type
28 help: consider removing the `?Sized` bound to make the type parameter `Sized`
30 LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
31 LL + fn f1<W: ?Sized, X, Y: ?Sized, Z: ?Sized>(x: &X) {
34 error[E0277]: the size for values of type `Z` cannot be known at compilation time
35 --> $DIR/unsized6.rs:11:12
37 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
38 | - this type parameter needs to be `std::marker::Sized`
40 LL | let y: (isize, (Z, usize));
41 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
43 = note: only the last element of a tuple may have a dynamically sized type
44 help: consider removing the `?Sized` bound to make the type parameter `Sized`
46 LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
47 LL + fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z>(x: &X) {
50 error[E0277]: the size for values of type `X` cannot be known at compilation time
51 --> $DIR/unsized6.rs:15:9
53 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
54 | - this type parameter needs to be `std::marker::Sized`
56 | ^ doesn't have a size known at compile-time
58 = note: all local variables must have a statically known size
59 = help: unsized locals are gated as an unstable feature
60 help: consider removing the `?Sized` bound to make the type parameter `Sized`
62 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
63 LL + fn f2<X, Y: ?Sized>(x: &X) {
66 error[E0277]: the size for values of type `Y` cannot be known at compilation time
67 --> $DIR/unsized6.rs:17:12
69 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
70 | - this type parameter needs to be `std::marker::Sized`
72 LL | let y: (isize, (Y, isize));
73 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
75 = note: only the last element of a tuple may have a dynamically sized type
76 help: consider removing the `?Sized` bound to make the type parameter `Sized`
78 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
79 LL + fn f2<X: ?Sized, Y>(x: &X) {
82 error[E0277]: the size for values of type `X` cannot be known at compilation time
83 --> $DIR/unsized6.rs:22:9
85 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
86 | - this type parameter needs to be `std::marker::Sized`
88 | ^ doesn't have a size known at compile-time
90 = note: all local variables must have a statically known size
91 = help: unsized locals are gated as an unstable feature
92 help: consider removing the `?Sized` bound to make the type parameter `Sized`
94 LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
95 LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
98 error[E0277]: the size for values of type `X` cannot be known at compilation time
99 --> $DIR/unsized6.rs:24:9
101 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
102 | - this type parameter needs to be `std::marker::Sized`
105 | ^ doesn't have a size known at compile-time
107 = note: all local variables must have a statically known size
108 = help: unsized locals are gated as an unstable feature
109 help: consider removing the `?Sized` bound to make the type parameter `Sized`
111 LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
112 LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
115 error[E0277]: the size for values of type `X` cannot be known at compilation time
116 --> $DIR/unsized6.rs:26:10
118 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
119 | - this type parameter needs to be `std::marker::Sized`
121 LL | let (y, z) = (*x3, 4);
122 | ^ doesn't have a size known at compile-time
124 = note: all local variables must have a statically known size
125 = help: unsized locals are gated as an unstable feature
126 help: consider removing the `?Sized` bound to make the type parameter `Sized`
128 LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
129 LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
132 error[E0277]: the size for values of type `X` cannot be known at compilation time
133 --> $DIR/unsized6.rs:30:9
135 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
136 | - this type parameter needs to be `std::marker::Sized`
138 | ^ doesn't have a size known at compile-time
140 = note: all local variables must have a statically known size
141 = help: unsized locals are gated as an unstable feature
142 help: consider removing the `?Sized` bound to make the type parameter `Sized`
144 LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
145 LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
148 error[E0277]: the size for values of type `X` cannot be known at compilation time
149 --> $DIR/unsized6.rs:32:9
151 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
152 | - this type parameter needs to be `std::marker::Sized`
155 | ^ doesn't have a size known at compile-time
157 = note: all local variables must have a statically known size
158 = help: unsized locals are gated as an unstable feature
159 help: consider removing the `?Sized` bound to make the type parameter `Sized`
161 LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
162 LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
165 error[E0277]: the size for values of type `X` cannot be known at compilation time
166 --> $DIR/unsized6.rs:34:10
168 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
169 | - this type parameter needs to be `std::marker::Sized`
171 LL | let (y, z) = (*x3, 4);
172 | ^ doesn't have a size known at compile-time
174 = note: all local variables must have a statically known size
175 = help: unsized locals are gated as an unstable feature
176 help: consider removing the `?Sized` bound to make the type parameter `Sized`
178 LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
179 LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
182 error[E0277]: the size for values of type `X` cannot be known at compilation time
183 --> $DIR/unsized6.rs:38:18
185 LL | fn g1<X: ?Sized>(x: X) {}
186 | - ^ doesn't have a size known at compile-time
188 | this type parameter needs to be `std::marker::Sized`
190 = help: unsized fn params are gated as an unstable feature
191 help: consider removing the `?Sized` bound to make the type parameter `Sized`
193 LL - fn g1<X: ?Sized>(x: X) {}
194 LL + fn g1<X>(x: X) {}
196 help: function arguments must have a statically known size, borrowed types always have a known size
198 LL | fn g1<X: ?Sized>(x: &X) {}
201 error[E0277]: the size for values of type `X` cannot be known at compilation time
202 --> $DIR/unsized6.rs:40:22
204 LL | fn g2<X: ?Sized + T>(x: X) {}
205 | - ^ doesn't have a size known at compile-time
207 | this type parameter needs to be `std::marker::Sized`
209 = help: unsized fn params are gated as an unstable feature
210 help: consider removing the `?Sized` bound to make the type parameter `Sized`
212 LL - fn g2<X: ?Sized + T>(x: X) {}
213 LL + fn g2<X: T>(x: X) {}
215 help: function arguments must have a statically known size, borrowed types always have a known size
217 LL | fn g2<X: ?Sized + T>(x: &X) {}
220 error: aborting due to 13 previous errors
222 For more information about this error, try `rustc --explain E0277`.