Skip to content

Commit cb7c75b

Browse files
committed
Temp: Fix debuginfo
1 parent aa6f3e5 commit cb7c75b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_mir_build/build/scope.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,12 @@ impl DropTree {
363363
cfg.push(block, stmt);
364364
let target = blocks[drop_data.1].unwrap();
365365
if target != block {
366+
// Diagnostics don't use this `Span` but debuginfo
367+
// might, which could cause breakpoints to end up in the
368+
// wrong place.
369+
let source_info = SourceInfo { span: DUMMY_SP, ..drop_data.0.source_info };
366370
let terminator = TerminatorKind::Goto { target };
367-
cfg.terminate(block, drop_data.0.source_info, terminator);
371+
cfg.terminate(block, source_info, terminator);
368372
}
369373
}
370374
}

0 commit comments

Comments
 (0)