This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit ceb60ad
committed
Auto merge of rust-lang#124203 - lukas-code:delete-deleting-caches, r=<try>
fix normalizing in different `ParamEnv`s with the same `InferCtxt`
This PR changes the key of the projection cache from just `AliasTy` to `(AliasTy, ParamEnv)` to allow normalizing in different `ParamEnv`s without resetting caches. Previously, normalizing the same alias in different param envs would always reuse the cached result from the first normalization, which is incorrect if the projection clauses in the param env have changed.
Fixing this bug allows us to get rid of `InferCtxt::clear_caches`, which was only used by the `AutoTraitFinder`, because it requires normalizing in different param envs.
r? `@fmease`File tree
6 files changed
+19
-27
lines changed- compiler
- rustc_infer/src
- infer
- traits
- rustc_trait_selection/src/traits
- select
6 files changed
+19
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | 1524 | | |
1534 | 1525 | | |
1535 | 1526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
179 | | - | |
180 | 178 | | |
181 | | - | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
| |||
255 | 252 | | |
256 | 253 | | |
257 | 254 | | |
258 | | - | |
259 | | - | |
260 | 255 | | |
261 | 256 | | |
262 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
| 761 | + | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| |||
2105 | 2105 | | |
2106 | 2106 | | |
2107 | 2107 | | |
2108 | | - | |
| 2108 | + | |
2109 | 2109 | | |
2110 | | - | |
| 2110 | + | |
2111 | 2111 | | |
2112 | 2112 | | |
2113 | 2113 | | |
2114 | 2114 | | |
2115 | | - | |
| 2115 | + | |
2116 | 2116 | | |
2117 | | - | |
| 2117 | + | |
2118 | 2118 | | |
2119 | 2119 | | |
2120 | 2120 | | |
2121 | 2121 | | |
2122 | | - | |
| 2122 | + | |
2123 | 2123 | | |
2124 | 2124 | | |
2125 | 2125 | | |
2126 | 2126 | | |
2127 | 2127 | | |
2128 | 2128 | | |
| 2129 | + | |
2129 | 2130 | | |
2130 | 2131 | | |
2131 | 2132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
819 | 822 | | |
820 | 823 | | |
821 | 824 | | |
| |||
844 | 847 | | |
845 | 848 | | |
846 | 849 | | |
847 | | - | |
848 | | - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
849 | 853 | | |
850 | 854 | | |
851 | 855 | | |
| |||
0 commit comments