Account for missing . in macros to avoid incorrect suggestion

This commit is contained in:
Esteban Küber 2024-11-16 00:10:48 +00:00
parent 1ce0fa98c7
commit cbbc7becc8
2 changed files with 4 additions and 4 deletions

View file

@ -763,6 +763,10 @@ impl<'a> Parser<'a> {
} else {
return;
}
if self.token.span == self.prev_token.span {
// Account for syntax errors in proc-macros.
return;
}
if self.look_ahead(1, |t| [token::Semi, token::Question, token::Dot].contains(&t.kind)) {
err.span_suggestion_verbose(
self.prev_token.span.between(self.token.span),