mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
syntax: bail out of find_width_of_character_at_span if the span doesn't start and end in the same file.
This commit is contained in:
@@ -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=`{:?}`",
|
||||
|
||||
Reference in New Issue
Block a user