about summary refs log tree commit diff
path: root/src/libsyntax/source_map.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-25 11:13:30 +0000
committerbors <bors@rust-lang.org>2019-10-25 11:13:30 +0000
commit23f890f10202a71168c6424da0cdf94135d3c40c (patch)
tree8d77ecdc401e9ae082a217c707d933ecd197708b /src/libsyntax/source_map.rs
parent85943fd7c88ddf870b03afdd6cd6782721c348e1 (diff)
parentc0bbb4bcdce880711c13b535fc4d9cd369741782 (diff)
downloadrust-23f890f10202a71168c6424da0cdf94135d3c40c.tar.gz
rust-23f890f10202a71168c6424da0cdf94135d3c40c.zip
Auto merge of #65804 - Centril:rollup-arlxgch, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #64639 (Stabilize `#[non_exhaustive]` (RFC 2008))
 - #65074 (Fix the start/end byte positions in the compiler JSON output)
 - #65315 (Intern place projection)
 - #65685 (Fix check of `statx` and handle EPERM)
 - #65731 (Prevent unnecessary allocation in PathBuf::set_extension.)
 - #65740 (Fix default "disable-shortcuts" feature value)
 - #65787 (move panictry! to where it is used.)
 - #65789 (move Attribute::with_desugared_doc to librustdoc)
 - #65790 (move report_invalid_macro_expansion_item to item.rs)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/source_map.rs')
-rw-r--r--src/libsyntax/source_map.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/source_map.rs b/src/libsyntax/source_map.rs
index a1d147637e2..d7760e0cf9e 100644
--- a/src/libsyntax/source_map.rs
+++ b/src/libsyntax/source_map.rs
@@ -283,6 +283,7 @@ impl SourceMap {
         mut file_local_lines: Vec<BytePos>,
         mut file_local_multibyte_chars: Vec<MultiByteChar>,
         mut file_local_non_narrow_chars: Vec<NonNarrowChar>,
+        mut file_local_normalized_pos: Vec<NormalizedPos>,
     ) -> Lrc<SourceFile> {
         let start_pos = self.next_start_pos();
 
@@ -301,6 +302,10 @@ impl SourceMap {
             *swc = *swc + start_pos;
         }
 
+        for nc in &mut file_local_normalized_pos {
+            nc.pos = nc.pos + start_pos;
+        }
+
         let source_file = Lrc::new(SourceFile {
             name: filename,
             name_was_remapped,
@@ -314,6 +319,7 @@ impl SourceMap {
             lines: file_local_lines,
             multibyte_chars: file_local_multibyte_chars,
             non_narrow_chars: file_local_non_narrow_chars,
+            normalized_pos: file_local_normalized_pos,
             name_hash,
         });