mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
2834b1654a
Fix ICE in `span_extend_prev_while` with multibyte characters Fixes https://github.com/rust-lang/rust/issues/155037 The function assumed that the character found by `rfind` was always one byte wide, using a hardcoded `1` instead of `c.len_utf8()`. When a multibyte character appeared immediately before the span, this caused the resulting span to point into the middle of a UTF-8 sequence, triggering an assertion failure in `bytepos_to_file_charpos`.