Commit 287a6e9
committed
Properly handle normalization
Previously normalization was broken, which caused a lot of fake errors.
This fix most type mismatches of the new solver, and it also reverts many test regressions.
The downside is that now `chalk_ir::TyKind::AssociatedType`/`chalk_ir::TyKind::Alias` cannot be trusted anymore with their roles, namely: `AssociatedType` is always fully normalized and `Alias` only if it can possibly be normalized further. That seems okay as the new solver does not have this distinction at all (due to it being a lazy normalizer), so this will only hold for the migration time. This does mean we have to change some APIs, notably `hir::Type::walk()` and `TyFingerprint`, to treat `Alias` the same as `AssociatedType`.
Another small thing this commit does is to isolate processing of user-written types (currently involving replacing error types and normalizing, but in the future validation will also be needed) to separate functions.1 parent 0f1adf4 commit 287a6e9
File tree
15 files changed
+235
-198
lines changed- crates
- hir-ty/src
- infer
- tests
- regression
- hir/src
15 files changed
+235
-198
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
922 | 924 | | |
923 | 925 | | |
924 | 926 | | |
925 | | - | |
| 927 | + | |
| 928 | + | |
926 | 929 | | |
927 | 930 | | |
928 | 931 | | |
929 | 932 | | |
930 | 933 | | |
931 | | - | |
| 934 | + | |
| 935 | + | |
932 | 936 | | |
933 | 937 | | |
934 | 938 | | |
| |||
946 | 950 | | |
947 | 951 | | |
948 | 952 | | |
949 | | - | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
950 | 959 | | |
951 | 960 | | |
952 | 961 | | |
| |||
1015 | 1024 | | |
1016 | 1025 | | |
1017 | 1026 | | |
1018 | | - | |
1019 | | - | |
| 1027 | + | |
1020 | 1028 | | |
1021 | 1029 | | |
1022 | 1030 | | |
1023 | 1031 | | |
1024 | | - | |
1025 | | - | |
| 1032 | + | |
1026 | 1033 | | |
1027 | 1034 | | |
1028 | 1035 | | |
| |||
1073 | 1080 | | |
1074 | 1081 | | |
1075 | 1082 | | |
1076 | | - | |
| 1083 | + | |
1077 | 1084 | | |
1078 | 1085 | | |
1079 | 1086 | | |
| |||
1415 | 1422 | | |
1416 | 1423 | | |
1417 | 1424 | | |
1418 | | - | |
1419 | | - | |
| 1425 | + | |
1420 | 1426 | | |
1421 | 1427 | | |
1422 | 1428 | | |
| |||
1562 | 1568 | | |
1563 | 1569 | | |
1564 | 1570 | | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1565 | 1590 | | |
1566 | 1591 | | |
1567 | 1592 | | |
1568 | 1593 | | |
1569 | 1594 | | |
1570 | 1595 | | |
1571 | | - | |
| 1596 | + | |
1572 | 1597 | | |
1573 | | - | |
| 1598 | + | |
| 1599 | + | |
1574 | 1600 | | |
1575 | 1601 | | |
1576 | 1602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
| 1422 | + | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
| |||
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
1634 | | - | |
| 1633 | + | |
1635 | 1634 | | |
1636 | 1635 | | |
1637 | 1636 | | |
| |||
1641 | 1640 | | |
1642 | 1641 | | |
1643 | 1642 | | |
1644 | | - | |
1645 | | - | |
| 1643 | + | |
1646 | 1644 | | |
1647 | 1645 | | |
1648 | 1646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
| 176 | + | |
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
183 | | - | |
| 181 | + | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
| |||
223 | 221 | | |
224 | 222 | | |
225 | 223 | | |
226 | | - | |
227 | | - | |
| 224 | + | |
228 | 225 | | |
229 | 226 | | |
230 | 227 | | |
| |||
0 commit comments