Skip to content

Commit

Permalink
Fix next_point to be unicode aware
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 10, 2020
1 parent fcd850f commit 3250057
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_span/source_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3250057

Please sign in to comment.