Skip to content

Commit 6590339

Browse files
Clean up E0205 explanation
1 parent bf84eb5 commit 6590339

File tree

1 file changed

+11
-5
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+11
-5
lines changed
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
You can only implement `Copy` for a struct or enum. Both of the following
2-
examples will fail, because neither `[u8; 256]` nor `&'static mut Bar`
3-
(mutable reference to `Bar`) is a struct or enum:
1+
The `Copy` trait was implemented on a type which is neither a struct nor an
2+
enum.
3+
4+
Erroneous code example:
45

56
```compile_fail,E0206
67
type Foo = [u8; 256];
7-
impl Copy for Foo { } // error
8+
impl Copy for Foo { } // error!
89
910
#[derive(Copy, Clone)]
1011
struct Bar;
11-
impl Copy for &'static mut Bar { } // error
12+
13+
impl Copy for &'static mut Bar { } // error!
1214
```
15+
16+
You can only implement `Copy` for a struct or an enum. Both of the previous
17+
examples will fail, because neither `[u8; 256]` nor `&'static mut Bar`
18+
(mutable reference to `Bar`) is a struct or enum.

0 commit comments

Comments
 (0)