]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_span/source_map.rs
Rollup merge of #67956 - varkor:E0588-provide-context, r=estebank
[rust.git] / src / librustc_span / source_map.rs
index ec1f9f3a7bdaf12f1f38c0387760e3e2a3101f11..fb5fcf4a8303badacd9ae0bdc69ec90b8607e7bb 100644 (file)
@@ -710,7 +710,7 @@ pub fn end_point(&self, sp: Span) -> Span {
     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.