]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/unsized6.stderr
Rollup merge of #103163 - SUPERCILEX:uninit-array-assume2, r=scottmcm
[rust.git] / src / test / ui / unsized / unsized6.stderr
1 error[E0277]: the size for values of type `Y` cannot be known at compilation time
2   --> $DIR/unsized6.rs:9:9
3    |
4 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
5    |                             - this type parameter needs to be `std::marker::Sized`
6 ...
7 LL |     let y: Y;
8    |         ^ doesn't have a size known at compile-time
9    |
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`
13    |
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) {
16    |
17
18 error[E0277]: the size for values of type `X` cannot be known at compilation time
19   --> $DIR/unsized6.rs:7:12
20    |
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
26    |
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`
29    |
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) {
32    |
33
34 error[E0277]: the size for values of type `Z` cannot be known at compilation time
35   --> $DIR/unsized6.rs:11:12
36    |
37 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
38    |                                        - this type parameter needs to be `std::marker::Sized`
39 ...
40 LL |     let y: (isize, (Z, usize));
41    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
42    |
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`
45    |
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) {
48    |
49
50 error[E0277]: the size for values of type `X` cannot be known at compilation time
51   --> $DIR/unsized6.rs:15:9
52    |
53 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
54    |       - this type parameter needs to be `std::marker::Sized`
55 LL |     let y: X;
56    |         ^ doesn't have a size known at compile-time
57    |
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`
61    |
62 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
63 LL + fn f2<X, Y: ?Sized>(x: &X) {
64    |
65
66 error[E0277]: the size for values of type `Y` cannot be known at compilation time
67   --> $DIR/unsized6.rs:17:12
68    |
69 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
70    |                  - this type parameter needs to be `std::marker::Sized`
71 ...
72 LL |     let y: (isize, (Y, isize));
73    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
74    |
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`
77    |
78 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
79 LL + fn f2<X: ?Sized, Y>(x: &X) {
80    |
81
82 error[E0277]: the size for values of type `X` cannot be known at compilation time
83   --> $DIR/unsized6.rs:22:9
84    |
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`
87 LL |     let y: X = *x1;
88    |         ^ doesn't have a size known at compile-time
89    |
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`
93    |
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>) {
96    |
97
98 error[E0277]: the size for values of type `X` cannot be known at compilation time
99   --> $DIR/unsized6.rs:24:9
100    |
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`
103 ...
104 LL |     let y = *x2;
105    |         ^ doesn't have a size known at compile-time
106    |
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`
110    |
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>) {
113    |
114
115 error[E0277]: the size for values of type `X` cannot be known at compilation time
116   --> $DIR/unsized6.rs:26:10
117    |
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`
120 ...
121 LL |     let (y, z) = (*x3, 4);
122    |          ^ doesn't have a size known at compile-time
123    |
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`
127    |
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>) {
130    |
131
132 error[E0277]: the size for values of type `X` cannot be known at compilation time
133   --> $DIR/unsized6.rs:30:9
134    |
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`
137 LL |     let y: X = *x1;
138    |         ^ doesn't have a size known at compile-time
139    |
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`
143    |
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>) {
146    |
147
148 error[E0277]: the size for values of type `X` cannot be known at compilation time
149   --> $DIR/unsized6.rs:32:9
150    |
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`
153 ...
154 LL |     let y = *x2;
155    |         ^ doesn't have a size known at compile-time
156    |
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`
160    |
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>) {
163    |
164
165 error[E0277]: the size for values of type `X` cannot be known at compilation time
166   --> $DIR/unsized6.rs:34:10
167    |
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`
170 ...
171 LL |     let (y, z) = (*x3, 4);
172    |          ^ doesn't have a size known at compile-time
173    |
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`
177    |
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>) {
180    |
181
182 error[E0277]: the size for values of type `X` cannot be known at compilation time
183   --> $DIR/unsized6.rs:38:18
184    |
185 LL | fn g1<X: ?Sized>(x: X) {}
186    |       -          ^ doesn't have a size known at compile-time
187    |       |
188    |       this type parameter needs to be `std::marker::Sized`
189    |
190    = help: unsized fn params are gated as an unstable feature
191 help: consider removing the `?Sized` bound to make the type parameter `Sized`
192    |
193 LL - fn g1<X: ?Sized>(x: X) {}
194 LL + fn g1<X>(x: X) {}
195    |
196 help: function arguments must have a statically known size, borrowed types always have a known size
197    |
198 LL | fn g1<X: ?Sized>(x: &X) {}
199    |                     +
200
201 error[E0277]: the size for values of type `X` cannot be known at compilation time
202   --> $DIR/unsized6.rs:40:22
203    |
204 LL | fn g2<X: ?Sized + T>(x: X) {}
205    |       -              ^ doesn't have a size known at compile-time
206    |       |
207    |       this type parameter needs to be `std::marker::Sized`
208    |
209    = help: unsized fn params are gated as an unstable feature
210 help: consider removing the `?Sized` bound to make the type parameter `Sized`
211    |
212 LL - fn g2<X: ?Sized + T>(x: X) {}
213 LL + fn g2<X: T>(x: X) {}
214    |
215 help: function arguments must have a statically known size, borrowed types always have a known size
216    |
217 LL | fn g2<X: ?Sized + T>(x: &X) {}
218    |                         +
219
220 error: aborting due to 13 previous errors
221
222 For more information about this error, try `rustc --explain E0277`.