Skip to content

Commit 3250057

Browse files
committed
Fix next_point to be unicode aware
1 parent fcd850f commit 3250057

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_span/source_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ impl SourceMap {
710710
pub fn next_point(&self, sp: Span) -> Span {
711711
let start_of_next_point = sp.hi().0;
712712

713-
let width = self.find_width_of_character_at_span(sp, true);
713+
let width = self.find_width_of_character_at_span(sp.shrink_to_hi(), true);
714714
// If the width is 1, then the next span should point to the same `lo` and `hi`. However,
715715
// in the case of a multibyte character, where the width != 1, the next span should
716716
// span multiple bytes to include the whole character.

0 commit comments

Comments
 (0)