summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0184.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0184.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0184.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0184.md b/compiler/rustc_error_codes/src/error_codes/E0184.md
new file mode 100644
index 000000000..4624f9e5b
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0184.md
@@ -0,0 +1,20 @@
+The `Copy` trait was implemented on a type with a `Drop` implementation.
+
+Erroneous code example:
+
+```compile_fail,E0184
+#[derive(Copy)]
+struct Foo; // error!
+
+impl Drop for Foo {
+ fn drop(&mut self) {
+ }
+}
+```
+
+Explicitly implementing both `Drop` and `Copy` trait on a type is currently
+disallowed. This feature can make some sense in theory, but the current
+implementation is incorrect and can lead to memory unsafety (see
+[issue #20126][iss20126]), so it has been disabled for now.
+
+[iss20126]: https://github.com/rust-lang/rust/issues/20126