Skip to content

Commit 60d7d28

Browse files
committed
MatchBranchSimplification: optimize when switching on copy operand
1 parent fd74026 commit 60d7d28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/transform/match_branches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification {
1616
'outer: for bb_idx in bbs.indices() {
1717
let (discr, val, switch_ty, first, second) = match bbs[bb_idx].terminator().kind {
1818
TerminatorKind::SwitchInt {
19-
discr: Operand::Move(ref place),
19+
discr: Operand::Copy(ref place) | Operand::Move(ref place),
2020
switch_ty,
2121
ref targets,
2222
ref values,

0 commit comments

Comments
 (0)