1
Fork 0

Improves parser diagnostics, fixes #93867

This commit is contained in:
threadexception 2022-05-01 19:05:35 +02:00
parent d201c812d4
commit 21fdd549f6
22 changed files with 135 additions and 33 deletions

View file

@ -262,7 +262,10 @@ impl<'a> Parser<'a> {
if let Ok(snip) = self.span_to_snippet(pat.span) {
err.span_label(pat.span, format!("while parsing the type for `{}`", snip));
}
let err = if self.check(&token::Eq) {
// we use noexpect here because we don't actually expect Eq to be here
// but we are still checking for it in order to be able to handle it if
// it is there
let err = if self.check_noexpect(&token::Eq) {
err.emit();
None
} else {