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

error[E0277]: the size for values of type `A` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:2:30
   |
LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
   |      -                       ^^^^^^ doesn't have a size known at compile-time
   |      |
   |      this type parameter needs to be `Sized`
   |
   = note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
LL + impl<A, B> Trait<(A, B)> for (A, B) where B: ?Sized, {}
   |

error[E0277]: the size for values of type `C` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:5:52
   |
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
   |                    -                               ^^^^^^^^^ doesn't have a size known at compile-time
   |                    |
   |                    this type parameter needs to be `Sized`
   |
   = note: required because it appears within the type `(A, B, C)`
note: required by a bound in `Trait`
  --> $DIR/unsized-bound.rs:1:13
   |
LL | trait Trait<A> {}
   |             ^ required by this bound in `Trait`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
LL + impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait<A: ?Sized> {}
   |              ++++++++

error[E0277]: the size for values of type `A` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:5:52
   |
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
   |      - this type parameter needs to be `Sized`     ^^^^^^^^^ doesn't have a size known at compile-time
   |
   = note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
LL + impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C)  {}
   |

error[E0277]: the size for values of type `B` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:5:52
   |
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
   |         - this type parameter needs to be `Sized`  ^^^^^^^^^ doesn't have a size known at compile-time
   |
   = note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
LL + impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
   |

error[E0277]: the size for values of type `B` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:10:47
   |
LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
   |                 -                             ^^^^^^ doesn't have a size known at compile-time
   |                 |
   |                 this type parameter needs to be `Sized`
   |
   = note: required because it appears within the type `(A, B)`
note: required by a bound in `Trait2`
  --> $DIR/unsized-bound.rs:9:14
   |
LL | trait Trait2<A> {}
   |              ^ required by this bound in `Trait2`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
LL + impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait2<A: ?Sized> {}
   |               ++++++++

error[E0277]: the size for values of type `A` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:10:47
   |
LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
   |      -                                        ^^^^^^ doesn't have a size known at compile-time
   |      |
   |      this type parameter needs to be `Sized`
   |
   = note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
LL + impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
   |

error[E0277]: the size for values of type `A` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:14:23
   |
LL | impl<A> Trait3<A> for A where A: ?Sized {}
   |      -                ^ doesn't have a size known at compile-time
   |      |
   |      this type parameter needs to be `Sized`
   |
note: required by a bound in `Trait3`
  --> $DIR/unsized-bound.rs:13:14
   |
LL | trait Trait3<A> {}
   |              ^ required by this bound in `Trait3`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A> Trait3<A> for A where A: ?Sized {}
LL + impl<A> Trait3<A> for A  {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait3<A: ?Sized> {}
   |               ++++++++

error[E0277]: the size for values of type `A` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:17:31
   |
LL | impl<A: ?Sized> Trait4<A> for A {}
   |      -                        ^ doesn't have a size known at compile-time
   |      |
   |      this type parameter needs to be `Sized`
   |
note: required by a bound in `Trait4`
  --> $DIR/unsized-bound.rs:16:14
   |
LL | trait Trait4<A> {}
   |              ^ required by this bound in `Trait4`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<A: ?Sized> Trait4<A> for A {}
LL + impl<A> Trait4<A> for A {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait4<A: ?Sized> {}
   |               ++++++++

error[E0277]: the size for values of type `X` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:20:29
   |
LL | impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
   |      -                      ^ doesn't have a size known at compile-time
   |      |
   |      this type parameter needs to be `Sized`
   |
note: required by a bound in `Trait5`
  --> $DIR/unsized-bound.rs:19:14
   |
LL | trait Trait5<A, B> {}
   |              ^ required by this bound in `Trait5`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
LL + impl<X, Y> Trait5<X, Y> for X  {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait5<A: ?Sized, B> {}
   |               ++++++++

error[E0277]: the size for values of type `X` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:23:37
   |
LL | impl<X: ?Sized, Y> Trait6<X, Y> for X {}
   |      -                              ^ doesn't have a size known at compile-time
   |      |
   |      this type parameter needs to be `Sized`
   |
note: required by a bound in `Trait6`
  --> $DIR/unsized-bound.rs:22:14
   |
LL | trait Trait6<A, B> {}
   |              ^ required by this bound in `Trait6`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<X: ?Sized, Y> Trait6<X, Y> for X {}
LL + impl<X, Y> Trait6<X, Y> for X {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait6<A: ?Sized, B> {}
   |               ++++++++

error[E0277]: the size for values of type `Y` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:26:12
   |
LL | impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
   |         -  ^^^^^^^^^^^^ doesn't have a size known at compile-time
   |         |
   |         this type parameter needs to be `Sized`
   |
note: required by a bound in `Trait7`
  --> $DIR/unsized-bound.rs:25:17
   |
LL | trait Trait7<A, B> {}
   |                 ^ required by this bound in `Trait7`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
LL + impl<X, Y> Trait7<X, Y> for X  {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait7<A, B: ?Sized> {}
   |                  ++++++++

error[E0277]: the size for values of type `Y` cannot be known at compilation time
  --> $DIR/unsized-bound.rs:29:20
   |
LL | impl<X, Y: ?Sized> Trait8<X, Y> for X {}
   |         -          ^^^^^^^^^^^^ doesn't have a size known at compile-time
   |         |
   |         this type parameter needs to be `Sized`
   |
note: required by a bound in `Trait8`
  --> $DIR/unsized-bound.rs:28:17
   |
LL | trait Trait8<A, B> {}
   |                 ^ required by this bound in `Trait8`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
LL - impl<X, Y: ?Sized> Trait8<X, Y> for X {}
LL + impl<X, Y> Trait8<X, Y> for X {}
   |
help: consider relaxing the implicit `Sized` restriction
   |
LL | trait Trait8<A, B: ?Sized> {}
   |                  ++++++++

error: aborting due to 13 previous errors

For more information about this error, try `rustc --explain E0277`.