about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-01-10 11:02:47 -0800
committerEsteban Küber <esteban@kuber.com.ar>2020-01-10 11:02:47 -0800
commit3250057da983fa4d5bfd0799adaa41cb038f0e25 (patch)
tree86f49679633c033ac303e84132a3faf2ce974af5
parentfcd850fc5db2501d14b2e0cbfac8aa890d700e55 (diff)
downloadrust-3250057da983fa4d5bfd0799adaa41cb038f0e25.tar.gz
rust-3250057da983fa4d5bfd0799adaa41cb038f0e25.zip
Fix `next_point` to be unicode aware
-rw-r--r--src/librustc_span/source_map.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs
index ec1f9f3a7bd..fb5fcf4a830 100644
--- a/src/librustc_span/source_map.rs
+++ b/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.