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

@ -288,7 +288,6 @@ pub struct Body<'tcx> {
impl<'tcx> Body<'tcx> {
pub fn new(
tcx: TyCtxt<'tcx>,
source: MirSource<'tcx>,
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
source_scopes: IndexVec<SourceScope, SourceScopeData<'tcx>>,
@ -331,7 +330,7 @@ impl<'tcx> Body<'tcx> {
predecessor_cache: PredecessorCache::new(),
is_cyclic: GraphIsCyclicCache::new(),
};
body.is_polymorphic = body.definitely_has_param_types_or_consts(tcx);
body.is_polymorphic = body.has_param_types_or_consts();
body
}
@ -341,7 +340,7 @@ impl<'tcx> Body<'tcx> {
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
/// crate.
pub fn new_cfg_only(basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>) -> Self {
Body {
let mut body = Body {
phase: MirPhase::Build,
source: MirSource::item(DefId::local(CRATE_DEF_INDEX)),
basic_blocks,
@ -357,7 +356,9 @@ impl<'tcx> Body<'tcx> {
is_polymorphic: false,
predecessor_cache: PredecessorCache::new(),
is_cyclic: GraphIsCyclicCache::new(),
}
};
body.is_polymorphic = body.has_param_types_or_consts();
body
}
#[inline]