Skip to content

Commit 90916d0

Browse files
committed
Temp: Fix debuginfo
1 parent c1a0042 commit 90916d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_mir/build/scope.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,12 @@ impl DropTree {
370370
cfg.push(block, stmt);
371371
let target = blocks[drop_data.1].unwrap();
372372
if target != block {
373+
// Diagnostics don't use this `Span` but debuginfo
374+
// might, which could cause breakpoints to end up in the
375+
// wrong place.
376+
let source_info = SourceInfo { span: DUMMY_SP, ..drop_data.0.source_info };
373377
let terminator = TerminatorKind::Goto { target };
374-
cfg.terminate(block, drop_data.0.source_info, terminator);
378+
cfg.terminate(block, source_info, terminator);
375379
}
376380
}
377381
}

0 commit comments

Comments
 (0)