File tree 1 file changed +18
-4
lines changed
src/librustc_error_codes/error_codes
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
- Explicitly implementing both Drop and Copy for a type is currently disallowed.
2
- This feature can make some sense in theory, but the current implementation is
3
- incorrect and can lead to memory unsafety (see [ issue #20126 ] [ iss20126 ] ), so
4
- it has been disabled for now.
1
+ The ` Copy ` trait was implemented on a type with a ` Drop ` implementation.
2
+
3
+ Erroneous code example:
4
+
5
+ ``` compile_fail,E0184
6
+ #[derive(Copy)]
7
+ struct Foo; // error!
8
+
9
+ impl Drop for Foo {
10
+ fn drop(&mut self) {
11
+ }
12
+ }
13
+ ```
14
+
15
+ Explicitly implementing both ` Drop ` and ` Copy ` trait on a type is currently
16
+ disallowed. This feature can make some sense in theory, but the current
17
+ implementation is incorrect and can lead to memory unsafety (see
18
+ [ issue #20126 ] [ iss20126 ] ), so it has been disabled for now.
5
19
6
20
[ iss20126 ] : https://github.com/rust-lang/rust/issues/20126
You can’t perform that action at this time.
0 commit comments