fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
8.5 KiB177 linesraw
1error[E0277]: the size for values of type `Y` cannot be known at compilation time
2  --> $DIR/unsized6.rs:9:9
3   |
4LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
5   |                             - this type parameter needs to be `std::marker::Sized`
6...
7LL |     let y: Y;
8   |         ^ doesn't have a size known at compile-time
9   |
10   = help: the trait `std::marker::Sized` is not implemented for `Y`
11   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
12   = note: all local variables must have a statically known size
13   = help: unsized locals are gated as an unstable feature
14
15error[E0277]: the size for values of type `X` cannot be known at compilation time
16  --> $DIR/unsized6.rs:7:12
17   |
18LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
19   |                  - this type parameter needs to be `std::marker::Sized`
20LL |     let _: W; // <-- this is OK, no bindings created, no initializer.
21LL |     let _: (isize, (X, isize));
22   |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
23   |
24   = help: the trait `std::marker::Sized` is not implemented for `X`
25   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
26   = note: only the last element of a tuple may have a dynamically sized type
27
28error[E0277]: the size for values of type `Z` cannot be known at compilation time
29  --> $DIR/unsized6.rs:11:12
30   |
31LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
32   |                                        - this type parameter needs to be `std::marker::Sized`
33...
34LL |     let y: (isize, (Z, usize));
35   |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
36   |
37   = help: the trait `std::marker::Sized` is not implemented for `Z`
38   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
39   = note: only the last element of a tuple may have a dynamically sized type
40
41error[E0277]: the size for values of type `X` cannot be known at compilation time
42  --> $DIR/unsized6.rs:15:9
43   |
44LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
45   |       - this type parameter needs to be `std::marker::Sized`
46LL |     let y: X;
47   |         ^ doesn't have a size known at compile-time
48   |
49   = help: the trait `std::marker::Sized` is not implemented for `X`
50   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
51   = note: all local variables must have a statically known size
52   = help: unsized locals are gated as an unstable feature
53
54error[E0277]: the size for values of type `Y` cannot be known at compilation time
55  --> $DIR/unsized6.rs:17:12
56   |
57LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
58   |                  - this type parameter needs to be `std::marker::Sized`
59...
60LL |     let y: (isize, (Y, isize));
61   |            ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
62   |
63   = help: the trait `std::marker::Sized` is not implemented for `Y`
64   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
65   = note: only the last element of a tuple may have a dynamically sized type
66
67error[E0277]: the size for values of type `X` cannot be known at compilation time
68  --> $DIR/unsized6.rs:22:9
69   |
70LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
71   |       - this type parameter needs to be `std::marker::Sized`
72LL |     let y: X = *x1;
73   |         ^ doesn't have a size known at compile-time
74   |
75   = help: the trait `std::marker::Sized` is not implemented for `X`
76   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
77   = note: all local variables must have a statically known size
78   = help: unsized locals are gated as an unstable feature
79
80error[E0277]: the size for values of type `X` cannot be known at compilation time
81  --> $DIR/unsized6.rs:24:9
82   |
83LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
84   |       - this type parameter needs to be `std::marker::Sized`
85...
86LL |     let y = *x2;
87   |         ^ doesn't have a size known at compile-time
88   |
89   = help: the trait `std::marker::Sized` is not implemented for `X`
90   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
91   = note: all local variables must have a statically known size
92   = help: unsized locals are gated as an unstable feature
93
94error[E0277]: the size for values of type `X` cannot be known at compilation time
95  --> $DIR/unsized6.rs:26:10
96   |
97LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
98   |       - this type parameter needs to be `std::marker::Sized`
99...
100LL |     let (y, z) = (*x3, 4);
101   |          ^ doesn't have a size known at compile-time
102   |
103   = help: the trait `std::marker::Sized` is not implemented for `X`
104   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
105   = note: all local variables must have a statically known size
106   = help: unsized locals are gated as an unstable feature
107
108error[E0277]: the size for values of type `X` cannot be known at compilation time
109  --> $DIR/unsized6.rs:30:9
110   |
111LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
112   |       - this type parameter needs to be `std::marker::Sized`
113LL |     let y: X = *x1;
114   |         ^ doesn't have a size known at compile-time
115   |
116   = help: the trait `std::marker::Sized` is not implemented for `X`
117   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
118   = note: all local variables must have a statically known size
119   = help: unsized locals are gated as an unstable feature
120
121error[E0277]: the size for values of type `X` cannot be known at compilation time
122  --> $DIR/unsized6.rs:32:9
123   |
124LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
125   |       - this type parameter needs to be `std::marker::Sized`
126...
127LL |     let y = *x2;
128   |         ^ doesn't have a size known at compile-time
129   |
130   = help: the trait `std::marker::Sized` is not implemented for `X`
131   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
132   = note: all local variables must have a statically known size
133   = help: unsized locals are gated as an unstable feature
134
135error[E0277]: the size for values of type `X` cannot be known at compilation time
136  --> $DIR/unsized6.rs:34:10
137   |
138LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
139   |       - this type parameter needs to be `std::marker::Sized`
140...
141LL |     let (y, z) = (*x3, 4);
142   |          ^ doesn't have a size known at compile-time
143   |
144   = help: the trait `std::marker::Sized` is not implemented for `X`
145   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
146   = note: all local variables must have a statically known size
147   = help: unsized locals are gated as an unstable feature
148
149error[E0277]: the size for values of type `X` cannot be known at compilation time
150  --> $DIR/unsized6.rs:38:18
151   |
152LL | fn g1<X: ?Sized>(x: X) {}
153   |       -          ^ doesn't have a size known at compile-time
154   |       |
155   |       this type parameter needs to be `std::marker::Sized`
156   |
157   = help: the trait `std::marker::Sized` is not implemented for `X`
158   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
159   = note: all local variables must have a statically known size
160   = help: unsized locals are gated as an unstable feature
161
162error[E0277]: the size for values of type `X` cannot be known at compilation time
163  --> $DIR/unsized6.rs:40:22
164   |
165LL | fn g2<X: ?Sized + T>(x: X) {}
166   |       -              ^ doesn't have a size known at compile-time
167   |       |
168   |       this type parameter needs to be `std::marker::Sized`
169   |
170   = help: the trait `std::marker::Sized` is not implemented for `X`
171   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
172   = note: all local variables must have a statically known size
173   = help: unsized locals are gated as an unstable feature
174
175error: aborting due to 13 previous errors
176
177For more information about this error, try `rustc --explain E0277`.