From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_error_codes/src/error_codes/E0184.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 compiler/rustc_error_codes/src/error_codes/E0184.md (limited to 'compiler/rustc_error_codes/src/error_codes/E0184.md') 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 -- cgit v1.2.3