Skip to content

Commit 42e65cb

Browse files
Auto merge of #147886 - dianqk:gvn-new-deref-arg, r=<try>
GVN: Use the borrows only if they are always live
2 parents 292be5c + c8fbb62 commit 42e65cb

29 files changed

+618
-436
lines changed

compiler/rustc_middle/src/mir/terminator.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -696,28 +696,6 @@ impl<'tcx> TerminatorKind<'tcx> {
696696
_ => None,
697697
}
698698
}
699-
700-
/// Returns true if the terminator can write to memory.
701-
pub fn can_write_to_memory(&self) -> bool {
702-
match self {
703-
TerminatorKind::Goto { .. }
704-
| TerminatorKind::SwitchInt { .. }
705-
| TerminatorKind::UnwindResume
706-
| TerminatorKind::UnwindTerminate(_)
707-
| TerminatorKind::Return
708-
| TerminatorKind::Assert { .. }
709-
| TerminatorKind::CoroutineDrop
710-
| TerminatorKind::FalseEdge { .. }
711-
| TerminatorKind::FalseUnwind { .. }
712-
| TerminatorKind::Unreachable => false,
713-
TerminatorKind::Call { .. }
714-
| TerminatorKind::Drop { .. }
715-
| TerminatorKind::TailCall { .. }
716-
// Yield writes to the resume_arg place.
717-
| TerminatorKind::Yield { .. }
718-
| TerminatorKind::InlineAsm { .. } => true,
719-
}
720-
}
721699
}
722700

723701
#[derive(Copy, Clone, Debug)]

0 commit comments

Comments
 (0)