rustc_parse_format: Fix character indices in find_skips

Fixes #81006
This commit is contained in:
Ömer Sinan Ağacan
2021-01-16 12:46:57 +03:00
parent d51cf9601c
commit 9111e9dd01
3 changed files with 25 additions and 1 deletions

View File

@@ -736,7 +736,7 @@ fn find_skips_from_snippet(
fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> {
let mut eat_ws = false;
let mut s = snippet.chars().enumerate().peekable();
let mut s = snippet.char_indices().peekable();
let mut skips = vec![];
while let Some((pos, c)) = s.next() {
match (c, s.peek()) {