]> 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 215618bd09ca375538e98701de332977dad45e3d..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=`{:?}`",
@@ -947,7 +952,7 @@ pub fn mark_span_with_reason(
             allow_internal_unstable,
             allow_internal_unsafe: false,
             local_inner_macros: false,
-            edition: hygiene::default_edition(),
+            edition: edition::Edition::from_session(),
         });
         span.with_ctxt(SyntaxContext::empty().apply_mark(mark))
     }