]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/source_map.rs
Auto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbini
[rust.git] / src / libsyntax / source_map.rs
index 8a210db91858ebb046da7023e668b6886d1478f8..e2171a84e23002b154160472fa8d3dd7ec6eb447 100644 (file)
@@ -727,6 +727,11 @@ fn find_width_of_character_at_span(&self, sp: Span, forwards: bool) -> u32 {
         debug!("find_width_of_character_at_span: local_begin=`{:?}`, local_end=`{:?}`",
                local_begin, local_end);
 
+        if local_begin.sf.start_pos != local_end.sf.start_pos {
+            debug!("find_width_of_character_at_span: begin and end are in different files");
+            return 1;
+        }
+
         let start_index = local_begin.pos.to_usize();
         let end_index = local_end.pos.to_usize();
         debug!("find_width_of_character_at_span: start_index=`{:?}`, end_index=`{:?}`",