]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0206.md
Stabilize File::options()
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0206.md
1 The `Copy` trait was implemented on a type which is neither a struct nor an
2 enum.
3
4 Erroneous code example:
5
6 ```compile_fail,E0206
7 type Foo = [u8; 256];
8 impl Copy for Foo { } // error!
9
10 #[derive(Copy, Clone)]
11 struct Bar;
12
13 impl Copy for &'static mut Bar { } // error!
14 ```
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.