about summary refs log tree commit diff
path: root/compiler/rustc_span/src/lib.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-05-25 14:47:28 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-05-26 08:56:49 +1000
commit3e810c64d091112cf8ac51a533068632fad30a8d (patch)
tree7160b6dd86a97e425c50949fab6c259d951089e2 /compiler/rustc_span/src/lib.rs
parentb2eed72a6fbf254e7d44942eaa121fcbed05d3fb (diff)
downloadrust-3e810c64d091112cf8ac51a533068632fad30a8d.tar.gz
rust-3e810c64d091112cf8ac51a533068632fad30a8d.zip
Augment a comment.
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
-rw-r--r--compiler/rustc_span/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index 8737e45487e..f44eac63cef 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -1270,7 +1270,9 @@ impl<S: Encoder> Encodable<S> for SourceFile {
                     // the lines list is sorted and individual lines are
                     // probably not that long. Because of that we can store lines
                     // as a difference list, using as little space as possible
-                    // for the differences.
+                    // for the differences. But note that the first line is
+                    // always encoded as a `BytePos` because its position is
+                    // often much larger than any of the differences.
                     let max_line_length = if lines.len() == 1 {
                         0
                     } else {