Commit 3c1ca17
committed
Require that types cannot implement both Drop and Copy.
Opt-in built-in traits allowed one to explicitly implement both `Drop`
and `Copy` for a type. This can theoretically make some sense, but the
current implementation means it is codegened totally incorrectly which
can lead to memory unsafety, so this feature is disabled for now.
Fixes #20126.1 parent c7dd3c4 commit 3c1ca17
File tree
5 files changed
+46
-3
lines changed- src
- librustc_typeck
- coherence
- librustc/middle
- test/compile-fail
5 files changed
+46
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6891 | 6891 | | |
6892 | 6892 | | |
6893 | 6893 | | |
| 6894 | + | |
6894 | 6895 | | |
6895 | 6896 | | |
6896 | 6897 | | |
| |||
6900 | 6901 | | |
6901 | 6902 | | |
6902 | 6903 | | |
6903 | | - | |
| 6904 | + | |
6904 | 6905 | | |
6905 | 6906 | | |
6906 | 6907 | | |
6907 | 6908 | | |
6908 | 6909 | | |
6909 | 6910 | | |
6910 | 6911 | | |
| 6912 | + | |
6911 | 6913 | | |
6912 | 6914 | | |
6913 | 6915 | | |
| |||
6920 | 6922 | | |
6921 | 6923 | | |
6922 | 6924 | | |
| 6925 | + | |
6923 | 6926 | | |
6924 | 6927 | | |
| 6928 | + | |
| 6929 | + | |
| 6930 | + | |
| 6931 | + | |
6925 | 6932 | | |
6926 | 6933 | | |
6927 | 6934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
| 161 | + | |
161 | 162 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments