summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-05 21:03:56 +0000
committerbors <bors@rust-lang.org>2023-09-05 21:03:56 +0000
commita991861ec9fd8aedffbe5744a8852c7c64dd40b2 (patch)
treeea4300be75a907b849ce41f5e116b29d57b40f88 /src/librustdoc/html
parentf91c53d73820251cc222356dcb65586469cf2018 (diff)
parent3edeac06a5722e9b29c350a22e54b8cc1396c62d (diff)
downloadrust-a991861ec9fd8aedffbe5744a8852c7c64dd40b2.tar.gz
rust-a991861ec9fd8aedffbe5744a8852c7c64dd40b2.zip
Auto merge of #115507 - cjgillot:relative-source-file, r=oli-obk
Use relative positions inside a SourceFile.

This allows to remove the normalization of start positions for hashing, and simplify allocation of global address space.

cc `@Zoxc`
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/sources.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs
index c4a1ebbec02..1d6eafe51b9 100644
--- a/src/librustdoc/html/sources.rs
+++ b/src/librustdoc/html/sources.rs
@@ -134,7 +134,7 @@ impl DocVisitor for SourceCollector<'_, '_> {
             let filename = span.filename(sess);
             let span = span.inner();
             let pos = sess.source_map().lookup_source_file(span.lo());
-            let file_span = span.with_lo(pos.start_pos).with_hi(pos.end_pos);
+            let file_span = span.with_lo(pos.start_pos).with_hi(pos.end_position());
             // If it turns out that we couldn't read this file, then we probably
             // can't read any of the files (generating html output from json or
             // something like that), so just don't include sources for the