From 763703cb7696d51b83bb8507e5a74a31144ac782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 11 Oct 2021 00:00:00 +0000 Subject: [PATCH] Remove redundant check for promoteds For some time CTFE has been using a dedicated MIR which is never optimized, so the check for promoted became redundant. --- .../rustc_mir_transform/src/uninhabited_enum_branching.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/rustc_mir_transform/src/uninhabited_enum_branching.rs b/compiler/rustc_mir_transform/src/uninhabited_enum_branching.rs index 2aa50611290..961c5009ac5 100644 --- a/compiler/rustc_mir_transform/src/uninhabited_enum_branching.rs +++ b/compiler/rustc_mir_transform/src/uninhabited_enum_branching.rs @@ -71,10 +71,6 @@ fn variant_discriminants<'tcx>( impl<'tcx> MirPass<'tcx> for UninhabitedEnumBranching { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if body.source.promoted.is_some() { - return; - } - trace!("UninhabitedEnumBranching starting for {:?}", body.source); let basic_block_count = body.basic_blocks().len();