File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 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
67type Foo = [u8; 256];
7- impl Copy for Foo { } // error
8+ impl Copy for Foo { } // error!
89
910#[derive(Copy, Clone)]
1011struct 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.
You can’t perform that action at this time.
0 commit comments