]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0206.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[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 #[derive(Copy, Clone)]
8 struct Bar;
9
10 impl Copy for &'static mut Bar { } // error!
11 ```
12
13 You can only implement `Copy` for a struct or an enum.
14 The previous example will fail because `&'static mut Bar`
15 is not a struct or enum.