X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_parse%2Fsrc%2Fparser%2Fstmt.rs;h=f18f7222b7ab62c2b7c16fec29dd8e2738dd2a38;hb=21fdd549f63499a6f15160c22175cc9c3bbeb473;hp=ac693597662e6e55c27ca68c7fbabcfa5cd958bf;hpb=a707f401074bc769bab4efb2bfdde7f6c5a4068d;p=rust.git diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index ac693597662..f18f7222b7a 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -262,7 +262,10 @@ fn parse_local(&mut self, attrs: AttrVec) -> PResult<'a, P> { 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 {