1
Fork 0

initial revert

This commit is contained in:
Ellen 2022-01-12 03:19:52 +00:00
parent b0ec3e09a9
commit 71bbb603f4
127 changed files with 540 additions and 1050 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]