summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0206.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0206.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0206.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0206.md b/compiler/rustc_error_codes/src/error_codes/E0206.md
new file mode 100644
index 000000000..4405a2149
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0206.md
@@ -0,0 +1,15 @@
+The `Copy` trait was implemented on a type which is neither a struct nor an
+enum.
+
+Erroneous code example:
+
+```compile_fail,E0206
+#[derive(Copy, Clone)]
+struct Bar;
+
+impl Copy for &'static mut Bar { } // error!
+```
+
+You can only implement `Copy` for a struct or an enum.
+The previous example will fail because `&'static mut Bar`
+is not a struct or enum.