diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /compiler/rustc_mir_transform/src/unreachable_prop.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_mir_transform/src/unreachable_prop.rs')
-rw-r--r-- | compiler/rustc_mir_transform/src/unreachable_prop.rs | 10 |
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; |