Closed
Description
Compile this code with debug info (-g):
1: fn main() {
2: zzz();
3: let s = String::from("sss");
4: zzz();
5: }
6:
7: fn zzz() {}
Set a breakpoint on line 2 and start line-stepping. The line position order will be something like this: 2, 3, 4, 3 (cleanup for s
), 1 (epilogue for main
).
I think everyone will agree that it would make much more sense to attribute the last two to line 5.
The fix will probably need to be done in rustc_trans::mir::MirContext::trans_block.
Also, this probably means that mir::SourceInfo
should carry a Pos
, not a Span
(we only ever use span.lo anyways).