Commit 27b4eb9
committed
Auto merge of rust-lang#116125 - RalfJung:const-param-ty-eq, r=compiler-errors
ConstParamTy: require Eq as supertrait
As discussed with `@BoxyUwu` [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/.60ConstParamTy.60.20and.20.60Eq.60).
We want to say that valtree equality on const generic params agrees with `==`, but that only makes sense if `==` actually exists, hence we should have an appropriate bound. Valtree equality is an equivalence relation, so such a type can always be `Eq` and not just `PartialEq`.File tree
5 files changed
+44
-6
lines changed- compiler
- rustc_builtin_macros/src/deriving
- rustc_resolve/src
- library/core/src
- tests/ui/const-generics/adt_const_params
5 files changed
+44
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2596 | 2596 | | |
2597 | 2597 | | |
2598 | 2598 | | |
2599 | | - | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
2600 | 2602 | | |
2601 | 2603 | | |
2602 | 2604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
989 | 994 | | |
990 | 995 | | |
991 | 996 | | |
992 | 997 | | |
993 | | - | |
| 998 | + | |
994 | 999 | | |
995 | 1000 | | |
996 | 1001 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
1 | 15 | | |
2 | 16 | | |
3 | 17 | | |
| |||
16 | 30 | | |
17 | 31 | | |
18 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
19 | 48 | | |
20 | | - | |
| 49 | + | |
21 | 50 | | |
22 | 51 | | |
23 | 52 | | |
| |||
27 | 56 | | |
28 | 57 | | |
29 | 58 | | |
30 | | - | |
| 59 | + | |
31 | 60 | | |
32 | 61 | | |
33 | 62 | | |
| |||
36 | 65 | | |
37 | 66 | | |
38 | 67 | | |
39 | | - | |
| 68 | + | |
40 | 69 | | |
41 | 70 | | |
0 commit comments