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.
This commit is contained in:
Tomasz Miąsko 2021-10-11 00:00:00 +00:00
parent 50f2c29200
commit 763703cb76

View File

@ -71,10 +71,6 @@ fn variant_discriminants<'tcx>(
impl<'tcx> MirPass<'tcx> for UninhabitedEnumBranching { impl<'tcx> MirPass<'tcx> for UninhabitedEnumBranching {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
if body.source.promoted.is_some() {
return;
}
trace!("UninhabitedEnumBranching starting for {:?}", body.source); trace!("UninhabitedEnumBranching starting for {:?}", body.source);
let basic_block_count = body.basic_blocks().len(); let basic_block_count = body.basic_blocks().len();