1
Fork 0

Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnr

partially revertish `lazily "compute" anon const default substs`

reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted
why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049>

r? `@lcnr`
This commit is contained in:
bors 2022-01-16 11:19:21 +00:00
commit 7be8693984
123 changed files with 405 additions and 886 deletions

View file

@ -342,7 +342,7 @@ fn inner_mir_for_ctfe(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -
}
}
debug_assert!(!body.has_free_regions(tcx), "Free regions in MIR for CTFE");
debug_assert!(!body.has_free_regions(), "Free regions in MIR for CTFE");
body
}
@ -529,7 +529,7 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
tcx.mir_drops_elaborated_and_const_checked(ty::WithOptConstParam::unknown(did)).steal();
run_optimization_passes(tcx, &mut body);
debug_assert!(!body.has_free_regions(tcx), "Free regions in optimized MIR");
debug_assert!(!body.has_free_regions(), "Free regions in optimized MIR");
body
}
@ -556,7 +556,7 @@ fn promoted_mir<'tcx>(
run_post_borrowck_cleanup_passes(tcx, body);
}
debug_assert!(!promoted.has_free_regions(tcx), "Free regions in promoted MIR");
debug_assert!(!promoted.has_free_regions(), "Free regions in promoted MIR");
tcx.arena.alloc(promoted)
}