]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_transform/src/unreachable_prop.rs
Auto merge of #104889 - GuillaumeGomez:fix-impl-block-in-const-expr, r=notriddle
[rust.git] / compiler / rustc_mir_transform / src / unreachable_prop.rs
index 95fda2eafe8a1799df333461355abe2eb2fc770f..06deca2fffb4889cc447878136b545a0243de852 100644 (file)
@@ -76,7 +76,7 @@ fn remove_successors<'tcx, F>(
     let terminator = match terminator_kind {
         // This will unconditionally run into an unreachable and is therefore unreachable as well.
         TerminatorKind::Goto { target } if is_unreachable(*target) => TerminatorKind::Unreachable,
-        TerminatorKind::SwitchInt { targets, discr, switch_ty } => {
+        TerminatorKind::SwitchInt { targets, discr } => {
             let otherwise = targets.otherwise();
 
             // If all targets are unreachable, we can be unreachable as well.
@@ -110,11 +110,7 @@ fn remove_successors<'tcx, F>(
                     return None;
                 }
 
-                TerminatorKind::SwitchInt {
-                    discr: discr.clone(),
-                    switch_ty: *switch_ty,
-                    targets: new_targets,
-                }
+                TerminatorKind::SwitchInt { discr: discr.clone(), targets: new_targets }
             } else {
                 // If the otherwise branch is reachable, we don't want to delete any unreachable branches.
                 return None;