Commit 8e91327
authored
Rollup merge of rust-lang#135520 - compiler-errors:mono-impossible-drop-with-lifetimes, r=BoxyUwU
Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs
Absolutely clueless mistake of mine. Whoops.
When eagerly collecting mono items, when we encounter an ADT, we try to monomorphize its drop glue. In rust-lang#135313, I made it so that this acts more like eagerly monomorphizing functions, where we allow (in this case) ADTs with lifetimes, since those can be erased by codegen.
However, I did not account for the call to `instantiate_and_check_impossible_predicates`, which was still passing an empty set of args. This means that if the ADT in question had any predicates, we'd get an index out of bounds panic.
This PR creates the correct set of args for the ADT.
Fixes rust-lang#135515. I assume that this manifests in that issue because of `-Clink-dead-code` or something.File tree
3 files changed
+32
-5
lines changed- compiler
- rustc_monomorphize/src
- rustc_type_ir/src
- tests/codegen-units/item-collection
3 files changed
+32
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1413 | 1428 | | |
1414 | 1429 | | |
1415 | 1430 | | |
1416 | 1431 | | |
1417 | 1432 | | |
1418 | | - | |
| 1433 | + | |
1419 | 1434 | | |
1420 | 1435 | | |
1421 | 1436 | | |
1422 | 1437 | | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
| 1438 | + | |
| 1439 | + | |
1426 | 1440 | | |
1427 | 1441 | | |
1428 | 1442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | | - | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments