We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29005cb commit 2449791Copy full SHA for 2449791
compiler/rustc_lexer/src/lib.rs
@@ -599,14 +599,16 @@ impl Cursor<'_> {
599
if potential_closing.is_none() {
600
// a less fortunate recovery if all else fails which finds any dashes preceded by whitespace
601
// on a standalone line. Might be wrong.
602
+ let mut base_index = 0;
603
while let Some(closing) = rest.find("---") {
604
let preceding_chars_start = rest[..closing].rfind("\n").map_or(0, |i| i + 1);
605
if rest[preceding_chars_start..closing].chars().all(is_horizontal_whitespace) {
606
// candidate found
- potential_closing = Some(closing);
607
+ potential_closing = Some(closing + base_index);
608
break;
609
} else {
610
rest = &rest[closing + 3..];
611
+ base_index += closing + 3;
612
}
613
614
0 commit comments