Commit a656bc5
authored
Rollup merge of rust-lang#90069 - tmiasko:promoted-const-qualif, r=oli-obk
Fix const qualification when executed after promotion
The const qualification was so far performed before the promotion and
the implementation assumed that it will never encounter a promoted.
With `const_precise_live_drops` feature, checking for live drops is
delayed until after drop elaboration, which in turn runs after
promotion. so the assumption is no longer true. When evaluating
`NeedsNonConstDrop` it is now possible to encounter promoteds.
Use type base qualification for the promoted. It is a sound
approximation in general, and in the specific case of promoteds and
`NeedsNonConstDrop` it is precise.
Fixes rust-lang#89938.File tree
2 files changed
+18
-2
lines changed- compiler/rustc_const_eval/src/transform/check_consts
- src/test/ui/consts
2 files changed
+18
-2
lines changedLines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
310 | 314 | | |
311 | 315 | | |
312 | 316 | | |
313 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
314 | 321 | | |
315 | | - | |
| 322 | + | |
316 | 323 | | |
317 | 324 | | |
318 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments