]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized6.stderr
Rollup merge of #80635 - sexxi-goose:use-place-instead-of-symbol, r=nikomatsakis`
[rust.git] / src / test / ui / 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 `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
13 error[E0277]: the size for values of type `X` cannot be known at compilation time
14   --> $DIR/unsized6.rs:7:12
15    |
16 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
17    |                  - this type parameter needs to be `Sized`
18 LL |     let _: W; // <-- this is OK, no bindings created, no initializer.
19 LL |     let _: (isize, (X, isize));
20    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
21    |
22    = note: only the last element of a tuple may have a dynamically sized type
23
24 error[E0277]: the size for values of type `Z` cannot be known at compilation time
25   --> $DIR/unsized6.rs:11:12
26    |
27 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
28    |                                        - this type parameter needs to be `Sized`
29 ...
30 LL |     let y: (isize, (Z, usize));
31    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
32    |
33    = note: only the last element of a tuple may have a dynamically sized type
34
35 error[E0277]: the size for values of type `X` cannot be known at compilation time
36   --> $DIR/unsized6.rs:15:9
37    |
38 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
39    |       - this type parameter needs to be `Sized`
40 LL |     let y: X;
41    |         ^ doesn't have a size known at compile-time
42    |
43    = note: all local variables must have a statically known size
44    = help: unsized locals are gated as an unstable feature
45
46 error[E0277]: the size for values of type `Y` cannot be known at compilation time
47   --> $DIR/unsized6.rs:17:12
48    |
49 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
50    |                  - this type parameter needs to be `Sized`
51 ...
52 LL |     let y: (isize, (Y, isize));
53    |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
54    |
55    = note: only the last element of a tuple may have a dynamically sized type
56
57 error[E0277]: the size for values of type `X` cannot be known at compilation time
58   --> $DIR/unsized6.rs:22:9
59    |
60 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
61    |       - this type parameter needs to be `Sized`
62 LL |     let y: X = *x1;
63    |         ^ doesn't have a size known at compile-time
64    |
65    = note: all local variables must have a statically known size
66    = help: unsized locals are gated as an unstable feature
67
68 error[E0277]: the size for values of type `X` cannot be known at compilation time
69   --> $DIR/unsized6.rs:24:9
70    |
71 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
72    |       - this type parameter needs to be `Sized`
73 ...
74 LL |     let y = *x2;
75    |         ^ doesn't have a size known at compile-time
76    |
77    = note: all local variables must have a statically known size
78    = help: unsized locals are gated as an unstable feature
79
80 error[E0277]: the size for values of type `X` cannot be known at compilation time
81   --> $DIR/unsized6.rs:26:10
82    |
83 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
84    |       - this type parameter needs to be `Sized`
85 ...
86 LL |     let (y, z) = (*x3, 4);
87    |          ^ doesn't have a size known at compile-time
88    |
89    = note: all local variables must have a statically known size
90    = help: unsized locals are gated as an unstable feature
91
92 error[E0277]: the size for values of type `X` cannot be known at compilation time
93   --> $DIR/unsized6.rs:30:9
94    |
95 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
96    |       - this type parameter needs to be `Sized`
97 LL |     let y: X = *x1;
98    |         ^ doesn't have a size known at compile-time
99    |
100    = note: all local variables must have a statically known size
101    = help: unsized locals are gated as an unstable feature
102
103 error[E0277]: the size for values of type `X` cannot be known at compilation time
104   --> $DIR/unsized6.rs:32:9
105    |
106 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
107    |       - this type parameter needs to be `Sized`
108 ...
109 LL |     let y = *x2;
110    |         ^ doesn't have a size known at compile-time
111    |
112    = note: all local variables must have a statically known size
113    = help: unsized locals are gated as an unstable feature
114
115 error[E0277]: the size for values of type `X` cannot be known at compilation time
116   --> $DIR/unsized6.rs:34:10
117    |
118 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
119    |       - this type parameter needs to be `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
127 error[E0277]: the size for values of type `X` cannot be known at compilation time
128   --> $DIR/unsized6.rs:38:18
129    |
130 LL | fn g1<X: ?Sized>(x: X) {}
131    |       -          ^ doesn't have a size known at compile-time
132    |       |
133    |       this type parameter needs to be `Sized`
134    |
135    = help: unsized fn params are gated as an unstable feature
136 help: function arguments must have a statically known size, borrowed types always have a known size
137    |
138 LL | fn g1<X: ?Sized>(&x: X) {}
139    |                  ^
140
141 error[E0277]: the size for values of type `X` cannot be known at compilation time
142   --> $DIR/unsized6.rs:40:22
143    |
144 LL | fn g2<X: ?Sized + T>(x: X) {}
145    |       -              ^ doesn't have a size known at compile-time
146    |       |
147    |       this type parameter needs to be `Sized`
148    |
149    = help: unsized fn params are gated as an unstable feature
150 help: function arguments must have a statically known size, borrowed types always have a known size
151    |
152 LL | fn g2<X: ?Sized + T>(&x: X) {}
153    |                      ^
154
155 error: aborting due to 13 previous errors
156
157 For more information about this error, try `rustc --explain E0277`.