diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs index 463de6a91c7..1b454b6667c 100644 --- a/src/debuginfo/line_info.rs +++ b/src/debuginfo/line_info.rs @@ -81,7 +81,7 @@ pub(crate) fn get_span_loc( match tcx.sess.source_map().lookup_line(span.lo()) { Ok(SourceFileAndLine { sf: file, line }) => { - let line_pos = file.line_begin_pos(span.lo()); + let line_pos = file.lines(|lines| lines[line]); ( file,