]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized6.stderr
Rollup merge of #65192 - estebank:restrict-bound, r=matthewjasper
[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    |                             -- help: consider further restricting this bound: `Y: std::marker::Sized +`
6 ...
7 LL |     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
15 error[E0277]: the size for values of type `X` cannot be known at compilation time
16   --> $DIR/unsized6.rs:7:12
17    |
18 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
19    |                  -- help: consider further restricting this bound: `X: std::marker::Sized +`
20 LL |     let _: W; // <-- this is OK, no bindings created, no initializer.
21 LL |     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
28 error[E0277]: the size for values of type `Z` cannot be known at compilation time
29   --> $DIR/unsized6.rs:11:12
30    |
31 LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
32    |                                        -- help: consider further restricting this bound: `Z: std::marker::Sized +`
33 ...
34 LL |     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
41 error[E0277]: the size for values of type `X` cannot be known at compilation time
42   --> $DIR/unsized6.rs:15:9
43    |
44 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
45    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
46 LL |     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
54 error[E0277]: the size for values of type `Y` cannot be known at compilation time
55   --> $DIR/unsized6.rs:17:12
56    |
57 LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
58    |                  -- help: consider further restricting this bound: `Y: std::marker::Sized +`
59 ...
60 LL |     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
67 error[E0277]: the size for values of type `X` cannot be known at compilation time
68   --> $DIR/unsized6.rs:22:9
69    |
70 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
71    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
72 LL |     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
80 error[E0277]: the size for values of type `X` cannot be known at compilation time
81   --> $DIR/unsized6.rs:24:9
82    |
83 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
84    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
85 ...
86 LL |     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
94 error[E0277]: the size for values of type `X` cannot be known at compilation time
95   --> $DIR/unsized6.rs:26:10
96    |
97 LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
98    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
99 ...
100 LL |     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
108 error[E0277]: the size for values of type `X` cannot be known at compilation time
109   --> $DIR/unsized6.rs:30:9
110    |
111 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
112    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
113 LL |     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
121 error[E0277]: the size for values of type `X` cannot be known at compilation time
122   --> $DIR/unsized6.rs:32:9
123    |
124 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
125    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
126 ...
127 LL |     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
135 error[E0277]: the size for values of type `X` cannot be known at compilation time
136   --> $DIR/unsized6.rs:34:10
137    |
138 LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
139    |       -- help: consider further restricting this bound: `X: std::marker::Sized +`
140 ...
141 LL |     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
149 error[E0277]: the size for values of type `X` cannot be known at compilation time
150   --> $DIR/unsized6.rs:38:18
151    |
152 LL | fn g1<X: ?Sized>(x: X) {}
153    |       --         ^ doesn't have a size known at compile-time
154    |       |
155    |       help: consider further restricting this bound: `X: 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
162 error[E0277]: the size for values of type `X` cannot be known at compilation time
163   --> $DIR/unsized6.rs:40:22
164    |
165 LL | fn g2<X: ?Sized + T>(x: X) {}
166    |       --             ^ doesn't have a size known at compile-time
167    |       |
168    |       help: consider further restricting this bound: `X: 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
175 error: aborting due to 13 previous errors
176
177 For more information about this error, try `rustc --explain E0277`.