about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-08-31 22:12:47 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-09-07 13:05:05 +0200
commit4ecfd30a8671baeb36b12c4827255ce89a740fd3 (patch)
treecfcd14c6084792f69a63d6e7c88e5d6e44606c0c
parentd4f12a5ed3e574b911965f0c2323e1008ee87afd (diff)
downloadrust-4ecfd30a8671baeb36b12c4827255ce89a740fd3.tar.gz
rust-4ecfd30a8671baeb36b12c4827255ce89a740fd3.zip
Use `Freeze` for `SourceFile.lines`
-rw-r--r--src/debuginfo/line_info.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs
index 998263de584..b19b935a0fe 100644
--- a/src/debuginfo/line_info.rs
+++ b/src/debuginfo/line_info.rs
@@ -81,7 +81,7 @@ impl DebugContext {
 
         match tcx.sess.source_map().lookup_line(span.lo()) {
             Ok(SourceFileAndLine { sf: file, line }) => {
-                let line_pos = file.lines(|lines| lines[line]);
+                let line_pos = file.lines()[line];
                 let col = file.relative_position(span.lo()) - line_pos;
 
                 (file, u64::try_from(line).unwrap() + 1, u64::from(col.to_u32()) + 1)