is_polymorphic doesn't matter for tests
This commit is contained in:
parent
5ba8f4d258
commit
283e0e670b
1 changed files with 3 additions and 8 deletions
|
@ -294,11 +294,8 @@ impl<'tcx> Body<'tcx> {
|
||||||
/// The returned MIR contains no `LocalDecl`s (even for the return place) or source scopes. It
|
/// The returned MIR contains no `LocalDecl`s (even for the return place) or source scopes. It
|
||||||
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
|
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
|
||||||
/// crate.
|
/// crate.
|
||||||
pub fn new_cfg_only(
|
pub fn new_cfg_only(basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>) -> Self {
|
||||||
tcx: TyCtxt<'tcx>,
|
Body {
|
||||||
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
|
|
||||||
) -> Self {
|
|
||||||
let mut body = Body {
|
|
||||||
phase: MirPhase::Build,
|
phase: MirPhase::Build,
|
||||||
source: MirSource::item(DefId::local(CRATE_DEF_INDEX)),
|
source: MirSource::item(DefId::local(CRATE_DEF_INDEX)),
|
||||||
basic_blocks,
|
basic_blocks,
|
||||||
|
@ -314,9 +311,7 @@ impl<'tcx> Body<'tcx> {
|
||||||
is_polymorphic: false,
|
is_polymorphic: false,
|
||||||
predecessor_cache: PredecessorCache::new(),
|
predecessor_cache: PredecessorCache::new(),
|
||||||
is_cyclic: GraphIsCyclicCache::new(),
|
is_cyclic: GraphIsCyclicCache::new(),
|
||||||
};
|
}
|
||||||
body.is_polymorphic = body.has_param_types_or_consts(tcx);
|
|
||||||
body
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue