@@ -150,6 +150,114 @@ attribute. Such a function must have the following type signature:
150
150
```
151
151
fn(isize, *const *const u8) -> isize
152
152
```
153
+ "## ,
154
+
155
+ E0184 : r##"
156
+ Explicitly implementing both Drop and Copy for a type is currently disallowed.
157
+ This feature can make some sense in theory, but the current implementation is
158
+ incorrect and can lead to memory unsafety (see issue #20126), so it has been
159
+ disabled for now.
160
+ "## ,
161
+
162
+ E0204 : r##"
163
+ An attempt to implement the `Copy` trait for a struct failed because one of the
164
+ fields does not implement `Copy`. To fix this, you must implement `Copy` for the
165
+ mentioned field. Note that this may not be possible, as in the example of
166
+
167
+ ```
168
+ struct Foo {
169
+ foo : Vec<u32>,
170
+ }
171
+
172
+ impl Copy for Foo { }
173
+ ```
174
+
175
+ This fails because `Vec<T>` does not implement `Copy` for any `T`.
176
+
177
+ Here's another example that will fail:
178
+
179
+ ```
180
+ #[derive(Copy)]
181
+ struct Foo<'a> {
182
+ ty: &'a mut bool,
183
+ }
184
+ ```
185
+
186
+ This fails because `&mut T` is not `Copy`, even when `T` is `Copy` (as opposed
187
+ to `&T`, which is).
188
+ "## ,
189
+
190
+ E0205 : r##"
191
+ An attempt to implement the `Copy` trait for an enum failed because one of the
192
+ variants does not implement `Copy`. To fix this, you must implement `Copy` for
193
+ the mentioned variant. Note that this may not be possible, as in the example of
194
+
195
+ ```
196
+ enum Foo {
197
+ Bar(Vec<u32>),
198
+ Baz,
199
+ }
200
+
201
+ impl Copy for Foo { }
202
+ ```
203
+
204
+ This fails because `Vec<T>` does not implement `Copy` for any `T`.
205
+
206
+ Here's another example that will fail:
207
+
208
+ ```
209
+ #[derive(Copy)]
210
+ enum Foo<'a> {
211
+ Bar(&'a mut bool),
212
+ Baz
213
+ }
214
+ ```
215
+
216
+ This fails because `&mut T` is not `Copy`, even when `T` is `Copy` (as opposed
217
+ to `&T`, which is).
218
+ "## ,
219
+
220
+ E0206 : r##"
221
+ You can only implement `Copy` for a struct or enum. For example, both of the
222
+ following examples will fail, because neither `i32` nor `&'static mut Bar` is
223
+ a struct or enum:
224
+
225
+ ```
226
+ type Foo = i32;
227
+ impl Copy for Foo { } // error
228
+
229
+ #[derive(Copy, Clone)]
230
+ struct Bar;
231
+ impl Copy for &'static mut Bar { } // error
232
+ ```
233
+ "## ,
234
+
235
+ E0243 : r##"
236
+ This error indicates that not enough type parameters were found in a type or
237
+ trait.
238
+
239
+ For example, the `Foo` struct below is defined to be generic in `T`, but the
240
+ type parameter is missing in the definition of `Bar`:
241
+
242
+ ```
243
+ struct Foo<T> { x: T }
244
+
245
+ struct Bar { x: Foo }
246
+ ```
247
+ "## ,
248
+
249
+ E0244 : r##"
250
+ This error indicates that too many type parameters were found in a type or
251
+ trait.
252
+
253
+ For example, the `Foo` struct below has no type parameters, but is supplied
254
+ with two in the definition of `Bar`:
255
+
256
+ ```
257
+ struct Foo { x: bool }
258
+
259
+ struct Bar<S, T> { x: Foo<S, T> }
260
+ ```
153
261
"##
154
262
155
263
}
@@ -232,7 +340,6 @@ register_diagnostics! {
232
340
E0178 ,
233
341
E0182 ,
234
342
E0183 ,
235
- E0184 ,
236
343
E0185 ,
237
344
E0186 ,
238
345
E0187 , // can't infer the kind of the closure
@@ -254,12 +361,6 @@ register_diagnostics! {
254
361
E0202 , // associated items are not allowed in inherent impls
255
362
E0203 , // type parameter has more than one relaxed default bound,
256
363
// and only one is supported
257
- E0204 , // trait `Copy` may not be implemented for this type; field
258
- // does not implement `Copy`
259
- E0205 , // trait `Copy` may not be implemented for this type; variant
260
- // does not implement `copy`
261
- E0206 , // trait `Copy` may not be implemented for this type; type is
262
- // not a structure or enumeration
263
364
E0207 , // type parameter is not constrained by the impl trait, self type, or predicate
264
365
E0208 ,
265
366
E0209 , // builtin traits can only be implemented on structs or enums
@@ -296,8 +397,6 @@ register_diagnostics! {
296
397
E0240 ,
297
398
E0241 ,
298
399
E0242 , // internal error looking up a definition
299
- E0243 , // wrong number of type arguments
300
- E0244 , // wrong number of type arguments
301
400
E0245 , // not a trait
302
401
E0246 , // illegal recursive type
303
402
E0247 , // found module name used as a type
0 commit comments