Skip to content
Permalink
Browse files

Fix `next_point` to be unicode aware

  • Loading branch information
estebank committed Jan 10, 2020
1 parent fcd850f commit 3250057da983fa4d5bfd0799adaa41cb038f0e25
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/librustc_span/source_map.rs
@@ -710,7 +710,7 @@ impl SourceMap {
pub fn next_point(&self, sp: Span) -> Span {
let start_of_next_point = sp.hi().0;

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

0 comments on commit 3250057

Please sign in to comment.
You can’t perform that action at this time.