Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs by compiler-errors · Pull Request #135520 · rust-lang/rust (original) (raw)
Absolutely clueless mistake of mine. Whoops.
When eagerly collecting mono items, when we encounter an ADT, we try to monomorphize its drop glue. In #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 #135515. I assume that this manifests in that issue because of -Clink-dead-code
or something.