summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_mir_transform/src/unreachable_prop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_mir_transform/src/unreachable_prop.rs')
-rw-r--r--compiler/rustc_mir_transform/src/unreachable_prop.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_mir_transform/src/unreachable_prop.rs b/compiler/rustc_mir_transform/src/unreachable_prop.rs
index 95fda2eaf..d4b1cfe43 100644
--- a/compiler/rustc_mir_transform/src/unreachable_prop.rs
+++ b/compiler/rustc_mir_transform/src/unreachable_prop.rs
@@ -76,7 +76,7 @@ where
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.
@@ -87,7 +87,7 @@ where
// unless otherwise is unreachable, in which case deleting a normal branch causes it to be merged with
// the otherwise, keeping its unreachable.
// This looses information about reachability causing worse codegen.
- // For example (see src/test/codegen/match-optimizes-away.rs)
+ // For example (see tests/codegen/match-optimizes-away.rs)
//
// pub enum Two { A, B }
// pub fn identity(x: Two) -> Two {
@@ -110,11 +110,7 @@ where
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;