]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized6.stderr
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / 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 help: consider borrowing here
18    |
19 LL |     let y: &Y;
20    |            +
21
22 error[E0277]: the size for values of type `X` cannot be known at compilation time
23   --> $DIR/unsized6.rs:7:12
24    |
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
30    |
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`
33    |
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) {
36    |
37
38 error[E0277]: the size for values of type `Z` cannot be known at compilation time
39   --> $DIR/unsized6.rs:11:12
40    |
41 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
42    |                                        - this type parameter needs to be `std::marker::Sized`
43 ...
44 LL |     let y: (isize, (Z, usize));
45    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
46    |
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`
49    |
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) {
52    |
53
54 error[E0277]: the size for values of type `X` cannot be known at compilation time
55   --> $DIR/unsized6.rs:15:9
56    |
57 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
58    |       - this type parameter needs to be `std::marker::Sized`
59 LL |     let y: X;
60    |         ^ doesn't have a size known at compile-time
61    |
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`
65    |
66 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
67 LL + fn f2<X, Y: ?Sized>(x: &X) {
68    |
69 help: consider borrowing here
70    |
71 LL |     let y: &X;
72    |            +
73
74 error[E0277]: the size for values of type `Y` cannot be known at compilation time
75   --> $DIR/unsized6.rs:17:12
76    |
77 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
78    |                  - this type parameter needs to be `std::marker::Sized`
79 ...
80 LL |     let y: (isize, (Y, isize));
81    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
82    |
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`
85    |
86 LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
87 LL + fn f2<X: ?Sized, Y>(x: &X) {
88    |
89
90 error[E0277]: the size for values of type `X` cannot be known at compilation time
91   --> $DIR/unsized6.rs:22:9
92    |
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`
95 LL |     let y: X = *x1;
96    |         ^ doesn't have a size known at compile-time
97    |
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`
101    |
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>) {
104    |
105 help: consider borrowing here
106    |
107 LL |     let y: &X = *x1;
108    |            +
109
110 error[E0277]: the size for values of type `X` cannot be known at compilation time
111   --> $DIR/unsized6.rs:24:9
112    |
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`
115 ...
116 LL |     let y = *x2;
117    |         ^ doesn't have a size known at compile-time
118    |
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`
122    |
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>) {
125    |
126
127 error[E0277]: the size for values of type `X` cannot be known at compilation time
128   --> $DIR/unsized6.rs:26:10
129    |
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`
132 ...
133 LL |     let (y, z) = (*x3, 4);
134    |          ^ doesn't have a size known at compile-time
135    |
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`
139    |
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>) {
142    |
143
144 error[E0277]: the size for values of type `X` cannot be known at compilation time
145   --> $DIR/unsized6.rs:30:9
146    |
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`
149 LL |     let y: X = *x1;
150    |         ^ doesn't have a size known at compile-time
151    |
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`
155    |
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>) {
158    |
159 help: consider borrowing here
160    |
161 LL |     let y: &X = *x1;
162    |            +
163
164 error[E0277]: the size for values of type `X` cannot be known at compilation time
165   --> $DIR/unsized6.rs:32:9
166    |
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`
169 ...
170 LL |     let y = *x2;
171    |         ^ doesn't have a size known at compile-time
172    |
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`
176    |
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>) {
179    |
180
181 error[E0277]: the size for values of type `X` cannot be known at compilation time
182   --> $DIR/unsized6.rs:34:10
183    |
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`
186 ...
187 LL |     let (y, z) = (*x3, 4);
188    |          ^ doesn't have a size known at compile-time
189    |
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`
193    |
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>) {
196    |
197
198 error[E0277]: the size for values of type `X` cannot be known at compilation time
199   --> $DIR/unsized6.rs:38:18
200    |
201 LL | fn g1<X: ?Sized>(x: X) {}
202    |       -          ^ doesn't have a size known at compile-time
203    |       |
204    |       this type parameter needs to be `std::marker::Sized`
205    |
206    = help: unsized fn params are gated as an unstable feature
207 help: consider removing the `?Sized` bound to make the type parameter `Sized`
208    |
209 LL - fn g1<X: ?Sized>(x: X) {}
210 LL + fn g1<X>(x: X) {}
211    |
212 help: function arguments must have a statically known size, borrowed types always have a known size
213    |
214 LL | fn g1<X: ?Sized>(x: &X) {}
215    |                     +
216
217 error[E0277]: the size for values of type `X` cannot be known at compilation time
218   --> $DIR/unsized6.rs:40:22
219    |
220 LL | fn g2<X: ?Sized + T>(x: X) {}
221    |       -              ^ doesn't have a size known at compile-time
222    |       |
223    |       this type parameter needs to be `std::marker::Sized`
224    |
225    = help: unsized fn params are gated as an unstable feature
226 help: consider removing the `?Sized` bound to make the type parameter `Sized`
227    |
228 LL - fn g2<X: ?Sized + T>(x: X) {}
229 LL + fn g2<X: T>(x: X) {}
230    |
231 help: function arguments must have a statically known size, borrowed types always have a known size
232    |
233 LL | fn g2<X: ?Sized + T>(x: &X) {}
234    |                         +
235
236 error: aborting due to 13 previous errors
237
238 For more information about this error, try `rustc --explain E0277`.