Skip to content

Commit c41e779

Browse files
committed
Auto merge of #115418 - Zoxc:freeze-source, r=oli-obk
Use `Freeze` for `SourceFile` This uses the `Freeze` type in `SourceFile` to let accessing `external_src` and `lines` be lock-free. Behavior of `add_external_src` is changed to set `ExternalSourceKind::AbsentErr` on a hash mismatch which matches the documentation. `ExternalSourceKind::Unneeded` was removed as it's unused. Based on rust-lang/rust#115401.
2 parents 6285086 + 4ecfd30 commit c41e779

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/debuginfo/line_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl DebugContext {
8181

8282
match tcx.sess.source_map().lookup_line(span.lo()) {
8383
Ok(SourceFileAndLine { sf: file, line }) => {
84-
let line_pos = file.lines(|lines| lines[line]);
84+
let line_pos = file.lines()[line];
8585
let col = file.relative_position(span.lo()) - line_pos;
8686

8787
(file, u64::try_from(line).unwrap() + 1, u64::from(col.to_u32()) + 1)

0 commit comments

Comments
 (0)