From c82e31086d61e34710522e8b956c6042dfa0ac71 Mon Sep 17 00:00:00 2001 From: Dillon Amburgey Date: Mon, 14 Jul 2025 10:11:00 -0500 Subject: [PATCH] fix: handle diverging calls correctly in SsaVisitor::visit_place to avoid invalid DefLocation --- compiler/rustc_mir_transform/src/ssa.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index cd9a7f4a39dfe..1ca1fcd29fc03 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -256,12 +256,12 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor<'_, 'tcx> { } PlaceContext::MutatingUse(MutatingUseContext::Call) => { let call = loc.block; - let TerminatorKind::Call { target, .. } = + let TerminatorKind::Call { target: Some(target), .. } = self.body.basic_blocks[call].terminator().kind else { - bug!() + return; }; - Some(DefLocation::CallReturn { call, target }) + Some(DefLocation::CallReturn { call, target: Some(target) }) } _ => None, };