]> git.proxmox.com Git - rustc.git/blob - tests/ui/trait-bounds/unsized-bound.stderr
New upstream version 1.72.1+dfsg1
[rustc.git] / tests / ui / trait-bounds / unsized-bound.stderr
1 error[E0277]: the size for values of type `B` cannot be known at compilation time
2 --> $DIR/unsized-bound.rs:2:30
3 |
4 LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
5 | - ^^^^^^ doesn't have a size known at compile-time
6 | |
7 | this type parameter needs to be `Sized`
8 |
9 = note: required because it appears within the type `(A, B)`
10 note: required by a bound in `Trait`
11 --> $DIR/unsized-bound.rs:1:13
12 |
13 LL | trait Trait<A> {}
14 | ^ required by this bound in `Trait`
15 help: consider removing the `?Sized` bound to make the type parameter `Sized`
16 |
17 LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
18 LL + impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, {}
19 |
20 help: consider relaxing the implicit `Sized` restriction
21 |
22 LL | trait Trait<A: ?Sized> {}
23 | ++++++++
24
25 error[E0277]: the size for values of type `A` cannot be known at compilation time
26 --> $DIR/unsized-bound.rs:2:30
27 |
28 LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
29 | - ^^^^^^ doesn't have a size known at compile-time
30 | |
31 | this type parameter needs to be `Sized`
32 |
33 = note: only the last element of a tuple may have a dynamically sized type
34 help: consider removing the `?Sized` bound to make the type parameter `Sized`
35 |
36 LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
37 LL + impl<A, B> Trait<(A, B)> for (A, B) where B: ?Sized, {}
38 |
39
40 error[E0277]: the size for values of type `C` cannot be known at compilation time
41 --> $DIR/unsized-bound.rs:5:52
42 |
43 LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
44 | - ^^^^^^^^^ doesn't have a size known at compile-time
45 | |
46 | this type parameter needs to be `Sized`
47 |
48 = note: required because it appears within the type `(A, B, C)`
49 note: required by a bound in `Trait`
50 --> $DIR/unsized-bound.rs:1:13
51 |
52 LL | trait Trait<A> {}
53 | ^ required by this bound in `Trait`
54 help: consider removing the `?Sized` bound to make the type parameter `Sized`
55 |
56 LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
57 LL + impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
58 |
59 help: consider relaxing the implicit `Sized` restriction
60 |
61 LL | trait Trait<A: ?Sized> {}
62 | ++++++++
63
64 error[E0277]: the size for values of type `A` cannot be known at compilation time
65 --> $DIR/unsized-bound.rs:5:52
66 |
67 LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
68 | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
69 |
70 = note: only the last element of a tuple may have a dynamically sized type
71 help: consider removing the `?Sized` bound to make the type parameter `Sized`
72 |
73 LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
74 LL + impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) {}
75 |
76
77 error[E0277]: the size for values of type `B` cannot be known at compilation time
78 --> $DIR/unsized-bound.rs:5:52
79 |
80 LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
81 | - this type parameter needs to be `Sized` ^^^^^^^^^ 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 - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
87 LL + impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
88 |
89
90 error[E0277]: the size for values of type `B` cannot be known at compilation time
91 --> $DIR/unsized-bound.rs:10:47
92 |
93 LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
94 | - ^^^^^^ doesn't have a size known at compile-time
95 | |
96 | this type parameter needs to be `Sized`
97 |
98 = note: required because it appears within the type `(A, B)`
99 note: required by a bound in `Trait2`
100 --> $DIR/unsized-bound.rs:9:14
101 |
102 LL | trait Trait2<A> {}
103 | ^ required by this bound in `Trait2`
104 help: consider removing the `?Sized` bound to make the type parameter `Sized`
105 |
106 LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
107 LL + impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
108 |
109 help: consider relaxing the implicit `Sized` restriction
110 |
111 LL | trait Trait2<A: ?Sized> {}
112 | ++++++++
113
114 error[E0277]: the size for values of type `A` cannot be known at compilation time
115 --> $DIR/unsized-bound.rs:10:47
116 |
117 LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
118 | - ^^^^^^ doesn't have a size known at compile-time
119 | |
120 | this type parameter needs to be `Sized`
121 |
122 = note: only the last element of a tuple may have a dynamically sized type
123 help: consider removing the `?Sized` bound to make the type parameter `Sized`
124 |
125 LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
126 LL + impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
127 |
128
129 error[E0277]: the size for values of type `A` cannot be known at compilation time
130 --> $DIR/unsized-bound.rs:14:23
131 |
132 LL | impl<A> Trait3<A> for A where A: ?Sized {}
133 | - ^ doesn't have a size known at compile-time
134 | |
135 | this type parameter needs to be `Sized`
136 |
137 note: required by a bound in `Trait3`
138 --> $DIR/unsized-bound.rs:13:14
139 |
140 LL | trait Trait3<A> {}
141 | ^ required by this bound in `Trait3`
142 help: consider removing the `?Sized` bound to make the type parameter `Sized`
143 |
144 LL - impl<A> Trait3<A> for A where A: ?Sized {}
145 LL + impl<A> Trait3<A> for A {}
146 |
147 help: consider relaxing the implicit `Sized` restriction
148 |
149 LL | trait Trait3<A: ?Sized> {}
150 | ++++++++
151
152 error[E0277]: the size for values of type `A` cannot be known at compilation time
153 --> $DIR/unsized-bound.rs:17:31
154 |
155 LL | impl<A: ?Sized> Trait4<A> for A {}
156 | - ^ doesn't have a size known at compile-time
157 | |
158 | this type parameter needs to be `Sized`
159 |
160 note: required by a bound in `Trait4`
161 --> $DIR/unsized-bound.rs:16:14
162 |
163 LL | trait Trait4<A> {}
164 | ^ required by this bound in `Trait4`
165 help: consider removing the `?Sized` bound to make the type parameter `Sized`
166 |
167 LL - impl<A: ?Sized> Trait4<A> for A {}
168 LL + impl<A> Trait4<A> for A {}
169 |
170 help: consider relaxing the implicit `Sized` restriction
171 |
172 LL | trait Trait4<A: ?Sized> {}
173 | ++++++++
174
175 error[E0277]: the size for values of type `X` cannot be known at compilation time
176 --> $DIR/unsized-bound.rs:20:29
177 |
178 LL | impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
179 | - ^ doesn't have a size known at compile-time
180 | |
181 | this type parameter needs to be `Sized`
182 |
183 note: required by a bound in `Trait5`
184 --> $DIR/unsized-bound.rs:19:14
185 |
186 LL | trait Trait5<A, B> {}
187 | ^ required by this bound in `Trait5`
188 help: consider removing the `?Sized` bound to make the type parameter `Sized`
189 |
190 LL - impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
191 LL + impl<X, Y> Trait5<X, Y> for X {}
192 |
193 help: consider relaxing the implicit `Sized` restriction
194 |
195 LL | trait Trait5<A: ?Sized, B> {}
196 | ++++++++
197
198 error[E0277]: the size for values of type `X` cannot be known at compilation time
199 --> $DIR/unsized-bound.rs:23:37
200 |
201 LL | impl<X: ?Sized, Y> Trait6<X, Y> for X {}
202 | - ^ doesn't have a size known at compile-time
203 | |
204 | this type parameter needs to be `Sized`
205 |
206 note: required by a bound in `Trait6`
207 --> $DIR/unsized-bound.rs:22:14
208 |
209 LL | trait Trait6<A, B> {}
210 | ^ required by this bound in `Trait6`
211 help: consider removing the `?Sized` bound to make the type parameter `Sized`
212 |
213 LL - impl<X: ?Sized, Y> Trait6<X, Y> for X {}
214 LL + impl<X, Y> Trait6<X, Y> for X {}
215 |
216 help: consider relaxing the implicit `Sized` restriction
217 |
218 LL | trait Trait6<A: ?Sized, B> {}
219 | ++++++++
220
221 error[E0277]: the size for values of type `Y` cannot be known at compilation time
222 --> $DIR/unsized-bound.rs:26:12
223 |
224 LL | impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
225 | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
226 | |
227 | this type parameter needs to be `Sized`
228 |
229 note: required by a bound in `Trait7`
230 --> $DIR/unsized-bound.rs:25:17
231 |
232 LL | trait Trait7<A, B> {}
233 | ^ required by this bound in `Trait7`
234 help: consider removing the `?Sized` bound to make the type parameter `Sized`
235 |
236 LL - impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
237 LL + impl<X, Y> Trait7<X, Y> for X {}
238 |
239 help: consider relaxing the implicit `Sized` restriction
240 |
241 LL | trait Trait7<A, B: ?Sized> {}
242 | ++++++++
243
244 error[E0277]: the size for values of type `Y` cannot be known at compilation time
245 --> $DIR/unsized-bound.rs:29:20
246 |
247 LL | impl<X, Y: ?Sized> Trait8<X, Y> for X {}
248 | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
249 | |
250 | this type parameter needs to be `Sized`
251 |
252 note: required by a bound in `Trait8`
253 --> $DIR/unsized-bound.rs:28:17
254 |
255 LL | trait Trait8<A, B> {}
256 | ^ required by this bound in `Trait8`
257 help: consider removing the `?Sized` bound to make the type parameter `Sized`
258 |
259 LL - impl<X, Y: ?Sized> Trait8<X, Y> for X {}
260 LL + impl<X, Y> Trait8<X, Y> for X {}
261 |
262 help: consider relaxing the implicit `Sized` restriction
263 |
264 LL | trait Trait8<A, B: ?Sized> {}
265 | ++++++++
266
267 error: aborting due to 13 previous errors
268
269 For more information about this error, try `rustc --explain E0277`.