Skip to content

Commit 4e9725c

Browse files
committed
Add a comment.
1 parent 3c735a0 commit 4e9725c

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_codegen_llvm/src/debuginfo

1 file changed

+5
-0
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,11 @@ impl<'ll, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
570570
inlined_at: Option<&'ll DILocation>,
571571
span: Span,
572572
) -> &'ll DILocation {
573+
// When emitting debugging information, DWARF (i.e. everything but MSVC)
574+
// treats line 0 as a magic value meaning that the code could not be
575+
// attributed to any line in the source. That's also exactly what dummy
576+
// spans are. Make that equivalence here, rather than passing dummy spans
577+
// to lookup_debug_loc, which will return line 1 for them.
573578
let (line, col) = if span.is_dummy() && !self.sess().target.is_like_msvc {
574579
(0, 0)
575580
} else {

0 commit comments

Comments
 (0)