Improves parser diagnostics, fixes #93867
This commit is contained in:
parent
d201c812d4
commit
21fdd549f6
22 changed files with 135 additions and 33 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue