]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #103521 - chenyukang:yukang/fix-103451-avoid-hang, r=jackh726,wesleywiser
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 9 Nov 2022 02:03:53 +0000 (21:03 -0500)
committerGitHub <noreply@github.com>
Wed, 9 Nov 2022 02:03:53 +0000 (21:03 -0500)
Avoid possible infinite  loop when next_point reaching the end of file

Fixes #103451
If we return a span with `lo` = `hi`, `span_to_snippet` will always get `Ok("")`, which may introduce infinite loop if we don't care.

This PR make `find_width_of_character_at_span` return `width` with 1, so that `span_to_snippet` will get an `Err`.


Trivial merge