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 = help: the trait `std::marker::Sized` is not implemented for `Y`
11 = note: all local variables must have a statically known size
12 = help: unsized locals are gated as an unstable feature
14 error[E0277]: the size for values of type `X` cannot be known at compilation time
15 --> $DIR/unsized6.rs:7:12
17 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
18 | - this type parameter needs to be `std::marker::Sized`
19 LL | let _: W; // <-- this is OK, no bindings created, no initializer.
20 LL | let _: (isize, (X, isize));
21 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
23 = help: the trait `std::marker::Sized` is not implemented for `X`
24 = note: only the last element of a tuple may have a dynamically sized type
26 error[E0277]: the size for values of type `Z` cannot be known at compilation time
27 --> $DIR/unsized6.rs:11:12
29 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
30 | - this type parameter needs to be `std::marker::Sized`
32 LL | let y: (isize, (Z, usize));
33 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
35 = help: the trait `std::marker::Sized` is not implemented for `Z`
36 = note: only the last element of a tuple may have a dynamically sized type
38 error[E0277]: the size for values of type `X` cannot be known at compilation time
39 --> $DIR/unsized6.rs:15:9
41 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
42 | - this type parameter needs to be `std::marker::Sized`
44 | ^ doesn't have a size known at compile-time
46 = help: the trait `std::marker::Sized` is not implemented for `X`
47 = note: all local variables must have a statically known size
48 = help: unsized locals are gated as an unstable feature
50 error[E0277]: the size for values of type `Y` cannot be known at compilation time
51 --> $DIR/unsized6.rs:17:12
53 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
54 | - this type parameter needs to be `std::marker::Sized`
56 LL | let y: (isize, (Y, isize));
57 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
59 = help: the trait `std::marker::Sized` is not implemented for `Y`
60 = note: only the last element of a tuple may have a dynamically sized type
62 error[E0277]: the size for values of type `X` cannot be known at compilation time
63 --> $DIR/unsized6.rs:22:9
65 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
66 | - this type parameter needs to be `std::marker::Sized`
68 | ^ doesn't have a size known at compile-time
70 = help: the trait `std::marker::Sized` is not implemented for `X`
71 = note: all local variables must have a statically known size
72 = help: unsized locals are gated as an unstable feature
74 error[E0277]: the size for values of type `X` cannot be known at compilation time
75 --> $DIR/unsized6.rs:24:9
77 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
78 | - this type parameter needs to be `std::marker::Sized`
81 | ^ doesn't have a size known at compile-time
83 = help: the trait `std::marker::Sized` is not implemented for `X`
84 = note: all local variables must have a statically known size
85 = help: unsized locals are gated as an unstable feature
87 error[E0277]: the size for values of type `X` cannot be known at compilation time
88 --> $DIR/unsized6.rs:26:10
90 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
91 | - this type parameter needs to be `std::marker::Sized`
93 LL | let (y, z) = (*x3, 4);
94 | ^ doesn't have a size known at compile-time
96 = help: the trait `std::marker::Sized` is not implemented for `X`
97 = note: all local variables must have a statically known size
98 = help: unsized locals are gated as an unstable feature
100 error[E0277]: the size for values of type `X` cannot be known at compilation time
101 --> $DIR/unsized6.rs:30:9
103 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
104 | - this type parameter needs to be `std::marker::Sized`
106 | ^ doesn't have a size known at compile-time
108 = help: the trait `std::marker::Sized` is not implemented for `X`
109 = note: all local variables must have a statically known size
110 = help: unsized locals are gated as an unstable feature
112 error[E0277]: the size for values of type `X` cannot be known at compilation time
113 --> $DIR/unsized6.rs:32:9
115 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
116 | - this type parameter needs to be `std::marker::Sized`
119 | ^ doesn't have a size known at compile-time
121 = help: the trait `std::marker::Sized` is not implemented for `X`
122 = note: all local variables must have a statically known size
123 = help: unsized locals are gated as an unstable feature
125 error[E0277]: the size for values of type `X` cannot be known at compilation time
126 --> $DIR/unsized6.rs:34:10
128 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
129 | - this type parameter needs to be `std::marker::Sized`
131 LL | let (y, z) = (*x3, 4);
132 | ^ doesn't have a size known at compile-time
134 = help: the trait `std::marker::Sized` is not implemented for `X`
135 = note: all local variables must have a statically known size
136 = help: unsized locals are gated as an unstable feature
138 error[E0277]: the size for values of type `X` cannot be known at compilation time
139 --> $DIR/unsized6.rs:38:18
141 LL | fn g1<X: ?Sized>(x: X) {}
142 | - ^ doesn't have a size known at compile-time
144 | this type parameter needs to be `std::marker::Sized`
146 = help: the trait `std::marker::Sized` is not implemented for `X`
147 = help: unsized locals are gated as an unstable feature
148 help: function arguments must have a statically known size, borrowed types always have a known size
150 LL | fn g1<X: ?Sized>(x: &X) {}
153 error[E0277]: the size for values of type `X` cannot be known at compilation time
154 --> $DIR/unsized6.rs:40:22
156 LL | fn g2<X: ?Sized + T>(x: X) {}
157 | - ^ doesn't have a size known at compile-time
159 | this type parameter needs to be `std::marker::Sized`
161 = help: the trait `std::marker::Sized` is not implemented for `X`
162 = help: unsized locals are gated as an unstable feature
163 help: function arguments must have a statically known size, borrowed types always have a known size
165 LL | fn g2<X: ?Sized + T>(x: &X) {}
168 error: aborting due to 13 previous errors
170 For more information about this error, try `rustc --explain E0277`.