-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit 52bf0cf
Auto merge of #140553 - BoxyUwU:defer_type_system_ctfe, r=compiler-errors
Defer evaluating type system constants when they use infers or params
Split out of #137972, the parts necessary for associated const equality and min generic const args to make progress and have correct semantics around when CTFE is invoked. According to a [previous perf run](https://perf.rust-lang.org/compare.html?start=93257e2d20809d82d1bc0fcc1942480d1a66d7cd&end=01b4cbf0f47c3f782330db88fa5ba199bba1f8a2&stat=instructions:u) of adding the new `const_arg_kind` query we should expect minor regressions here.
I think this is acceptable as we should be able to remove this query relatively soon once mgca is more complete as we'll then be able to implement GCE in terms of mgca and rip out `GCEConst` at which point it's trivial to determine what kind of anon const we're dealing with (either it has generics and is a repeat expr hack, or it doesnt and is a normal anon const).
This should only affect unstable code as we handle repeat exprs specially and those are the only kinds of type system consts that are allowed to make use of generic parameters.
Fixes #133066
Fixes #133199
Fixes #136894
Fixes #137813
r? compiler-errorsFile tree
31 files changed
+546
-189
lines changed- compiler
- rustc_hir_analysis/src
- collect
- rustc_metadata/src/rmeta
- decoder
- rustc_middle/src
- query
- ty
- rustc_trait_selection/src/traits
- tests
- crashes
- ui
- const-generics
- associated_const_equality
- generic_const_exprs
- auxiliary
- issues
- pattern
- type-alias-impl-trait
31 files changed
+546
-189
lines changedLines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 | + | ||
91 | 92 |
| |
92 | 93 |
| |
93 | 94 |
| |
| |||
1826 | 1827 |
| |
1827 | 1828 |
| |
1828 | 1829 |
| |
1830 | + | ||
1831 | + | ||
1832 | + | ||
1833 | + | ||
1834 | + | ||
1835 | + | ||
1836 | + | ||
1837 | + | ||
1838 | + | ||
1839 | + | ||
1840 | + | ||
1841 | + | ||
1842 | + | ||
1843 | + | ||
1844 | + | ||
1845 | + | ||
1846 | + | ||
1847 | + | ||
1848 | + | ||
1849 | + | ||
1850 | + | ||
1851 | + | ||
1852 | + | ||
1853 | + |
Lines changed: 30 additions & 41 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
107 | - | ||
108 | - | ||
109 | - | ||
110 | - | ||
111 | - | ||
112 | - | ||
113 | - | ||
114 | - | ||
115 | - | ||
116 | - | ||
117 | - | ||
118 | - | ||
119 | - | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | + | ||
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | ||
120 | 128 |
| |
121 | 129 |
| |
122 | 130 |
| |
| |||
160 | 168 |
| |
161 | 169 |
| |
162 | 170 |
| |
163 | - | ||
164 | - | ||
165 | - | ||
166 | - | ||
167 | - | ||
168 | - | ||
169 | - | ||
170 | - | ||
171 | 171 |
| |
172 | - | ||
173 | - | ||
174 | - | ||
175 | - | ||
176 | - | ||
177 | - | ||
178 | - | ||
179 | - | ||
180 | - | ||
181 | - | ||
182 | - | ||
183 | - | ||
184 | - | ||
185 | - | ||
186 | - | ||
187 | - | ||
188 | - | ||
189 | - | ||
190 | - | ||
191 | - | ||
172 | + | ||
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | ||
192 | 179 |
| |
180 | + | ||
181 | + | ||
193 | 182 |
| |
194 | 183 |
| |
195 | 184 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
425 | 425 |
| |
426 | 426 |
| |
427 | 427 |
| |
428 | + | ||
428 | 429 |
| |
429 | 430 |
| |
430 | 431 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1569 | 1569 |
| |
1570 | 1570 |
| |
1571 | 1571 |
| |
1572 | + | ||
1573 | + | ||
1574 | + | ||
1572 | 1575 |
| |
1573 | 1576 |
| |
1574 | 1577 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
480 | 480 |
| |
481 | 481 |
| |
482 | 482 |
| |
483 | + | ||
483 | 484 |
| |
484 | 485 |
| |
485 | 486 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
319 | + | ||
319 | 320 |
| |
320 | 321 |
| |
321 | 322 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2592 | 2592 |
| |
2593 | 2593 |
| |
2594 | 2594 |
| |
2595 | + | ||
2596 | + | ||
2597 | + | ||
2598 | + | ||
2599 | + | ||
2595 | 2600 |
| |
2596 | 2601 |
| |
2597 | 2602 |
| |
|
Lines changed: 14 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 | - | ||
5 | + | ||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | ||
266 | + | ||
267 | + | ||
268 | + | ||
269 | + | ||
270 | + | ||
271 | + | ||
272 | + | ||
273 | + | ||
274 | + |
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 | - | ||
78 | - | ||
77 | + | ||
78 | + | ||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 | + | ||
71 | 72 |
| |
72 | 73 |
| |
73 | 74 |
| |
|
0 commit comments