about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2021-10-11 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2021-11-20 10:12:04 +0100
commit763703cb7696d51b83bb8507e5a74a31144ac782 (patch)
tree1583378109ca6d56550f24c0f5eb442f5e872db4
parent50f2c292007f9364908e4b8344886797f0144648 (diff)
downloadrust-763703cb7696d51b83bb8507e5a74a31144ac782.tar.gz
rust-763703cb7696d51b83bb8507e5a74a31144ac782.zip
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.
-rw-r--r--compiler/rustc_mir_transform/src/uninhabited_enum_branching.rs4
1 files changed, 0 insertions, 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();