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) {
17 help: consider borrowing here
22 error[E0277]: the size for values of type `X` cannot be known at compilation time
23 --> $DIR/unsized6.rs:7:12
25 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
26 | - this type parameter needs to be `std::marker::Sized`
27 LL | let _: W; // <-- this is OK, no bindings created, no initializer.
28 LL | let _: (isize, (X, isize));
29 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
31 = note: only the last element of a tuple may have a dynamically sized type
32 help: consider removing the `?Sized` bound to make the type parameter `Sized`
34 LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
35 LL + fn f1<W: ?Sized, X, Y: ?Sized, Z: ?Sized>(x: &X) {
38 error[E0277]: the size for values of type `Z` cannot be known at compilation time
39 --> $DIR/unsized6.rs:11:12
41 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
42 | - this type parameter needs to be `std::marker::Sized`
44 LL | let y: (isize, (Z, usize));
45 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
47 = note: only the last element of a tuple may have a dynamically sized type
48 help: consider removing the `?Sized` bound to make the type parameter `Sized`
50 LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
51 LL + fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z>(x: &X) {
54 error[E0277]: the size for values of type `X` cannot be known at compilation time
55 --> $DIR/unsized6.rs:15:9
57 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
58 | - this type parameter needs to be `std::marker::Sized`
60 | ^ doesn't have a size known at compile-time
62 = note: all local variables must have a statically known size
63 = help: unsized locals are gated as an unstable feature
64 help: consider removing the `?Sized` bound to make the type parameter `Sized`
66 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
67 LL + fn f2<X, Y: ?Sized>(x: &X) {
69 help: consider borrowing here
74 error[E0277]: the size for values of type `Y` cannot be known at compilation time
75 --> $DIR/unsized6.rs:17:12
77 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
78 | - this type parameter needs to be `std::marker::Sized`
80 LL | let y: (isize, (Y, isize));
81 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
83 = note: only the last element of a tuple may have a dynamically sized type
84 help: consider removing the `?Sized` bound to make the type parameter `Sized`
86 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
87 LL + fn f2<X: ?Sized, Y>(x: &X) {
90 error[E0277]: the size for values of type `X` cannot be known at compilation time
91 --> $DIR/unsized6.rs:22:9
93 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
94 | - this type parameter needs to be `std::marker::Sized`
96 | ^ doesn't have a size known at compile-time
98 = note: all local variables must have a statically known size
99 = help: unsized locals are gated as an unstable feature
100 help: consider removing the `?Sized` bound to make the type parameter `Sized`
102 LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
103 LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
105 help: consider borrowing here
107 LL | let y: &X = *x1;
110 error[E0277]: the size for values of type `X` cannot be known at compilation time
111 --> $DIR/unsized6.rs:24:9
113 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
114 | - this type parameter needs to be `std::marker::Sized`
117 | ^ doesn't have a size known at compile-time
119 = note: all local variables must have a statically known size
120 = help: unsized locals are gated as an unstable feature
121 help: consider removing the `?Sized` bound to make the type parameter `Sized`
123 LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
124 LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
127 error[E0277]: the size for values of type `X` cannot be known at compilation time
128 --> $DIR/unsized6.rs:26:10
130 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
131 | - this type parameter needs to be `std::marker::Sized`
133 LL | let (y, z) = (*x3, 4);
134 | ^ doesn't have a size known at compile-time
136 = note: all local variables must have a statically known size
137 = help: unsized locals are gated as an unstable feature
138 help: consider removing the `?Sized` bound to make the type parameter `Sized`
140 LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
141 LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
144 error[E0277]: the size for values of type `X` cannot be known at compilation time
145 --> $DIR/unsized6.rs:30:9
147 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
148 | - this type parameter needs to be `std::marker::Sized`
150 | ^ doesn't have a size known at compile-time
152 = note: all local variables must have a statically known size
153 = help: unsized locals are gated as an unstable feature
154 help: consider removing the `?Sized` bound to make the type parameter `Sized`
156 LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
157 LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
159 help: consider borrowing here
161 LL | let y: &X = *x1;
164 error[E0277]: the size for values of type `X` cannot be known at compilation time
165 --> $DIR/unsized6.rs:32:9
167 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
168 | - this type parameter needs to be `std::marker::Sized`
171 | ^ doesn't have a size known at compile-time
173 = note: all local variables must have a statically known size
174 = help: unsized locals are gated as an unstable feature
175 help: consider removing the `?Sized` bound to make the type parameter `Sized`
177 LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
178 LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
181 error[E0277]: the size for values of type `X` cannot be known at compilation time
182 --> $DIR/unsized6.rs:34:10
184 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
185 | - this type parameter needs to be `std::marker::Sized`
187 LL | let (y, z) = (*x3, 4);
188 | ^ doesn't have a size known at compile-time
190 = note: all local variables must have a statically known size
191 = help: unsized locals are gated as an unstable feature
192 help: consider removing the `?Sized` bound to make the type parameter `Sized`
194 LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
195 LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
198 error[E0277]: the size for values of type `X` cannot be known at compilation time
199 --> $DIR/unsized6.rs:38:18
201 LL | fn g1<X: ?Sized>(x: X) {}
202 | - ^ doesn't have a size known at compile-time
204 | this type parameter needs to be `std::marker::Sized`
206 = help: unsized fn params are gated as an unstable feature
207 help: consider removing the `?Sized` bound to make the type parameter `Sized`
209 LL - fn g1<X: ?Sized>(x: X) {}
210 LL + fn g1<X>(x: X) {}
212 help: function arguments must have a statically known size, borrowed types always have a known size
214 LL | fn g1<X: ?Sized>(x: &X) {}
217 error[E0277]: the size for values of type `X` cannot be known at compilation time
218 --> $DIR/unsized6.rs:40:22
220 LL | fn g2<X: ?Sized + T>(x: X) {}
221 | - ^ doesn't have a size known at compile-time
223 | this type parameter needs to be `std::marker::Sized`
225 = help: unsized fn params are gated as an unstable feature
226 help: consider removing the `?Sized` bound to make the type parameter `Sized`
228 LL - fn g2<X: ?Sized + T>(x: X) {}
229 LL + fn g2<X: T>(x: X) {}
231 help: function arguments must have a statically known size, borrowed types always have a known size
233 LL | fn g2<X: ?Sized + T>(x: &X) {}
236 error: aborting due to 13 previous errors
238 For more information about this error, try `rustc --explain E0277`.