inliner: Use substs_for_mir_body
Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account.
This commit is contained in:
parent
9d78d1d027
commit
8a8ee1a3ed
9 changed files with 142 additions and 42 deletions
|
@ -543,11 +543,11 @@ impl<'a, 'tcx> MirNeighborCollector<'a, 'tcx> {
|
|||
T: TypeFoldable<'tcx>,
|
||||
{
|
||||
debug!("monomorphize: self.instance={:?}", self.instance);
|
||||
if let Some(substs) = self.instance.substs_for_mir_body() {
|
||||
self.tcx.subst_and_normalize_erasing_regions(substs, ty::ParamEnv::reveal_all(), &value)
|
||||
} else {
|
||||
self.tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), value)
|
||||
}
|
||||
self.instance.subst_mir_and_normalize_erasing_regions(
|
||||
self.tcx,
|
||||
ty::ParamEnv::reveal_all(),
|
||||
&value,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue