Skip to content

Commit 283e0e6

Browse files
committed
is_polymorphic doesn't matter for tests
1 parent 5ba8f4d commit 283e0e6

File tree

1 file changed

+3
-8
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+3
-8
lines changed

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,8 @@ impl<'tcx> Body<'tcx> {
294294
/// The returned MIR contains no `LocalDecl`s (even for the return place) or source scopes. It
295295
/// is only useful for testing but cannot be `#[cfg(test)]` because it is used in a different
296296
/// crate.
297-
pub fn new_cfg_only(
298-
tcx: TyCtxt<'tcx>,
299-
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
300-
) -> Self {
301-
let mut body = Body {
297+
pub fn new_cfg_only(basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>) -> Self {
298+
Body {
302299
phase: MirPhase::Build,
303300
source: MirSource::item(DefId::local(CRATE_DEF_INDEX)),
304301
basic_blocks,
@@ -314,9 +311,7 @@ impl<'tcx> Body<'tcx> {
314311
is_polymorphic: false,
315312
predecessor_cache: PredecessorCache::new(),
316313
is_cyclic: GraphIsCyclicCache::new(),
317-
};
318-
body.is_polymorphic = body.has_param_types_or_consts(tcx);
319-
body
314+
}
320315
}
321316

322317
#[inline]

0 commit comments

Comments
 (0)