diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e7c46bfd7bc51e2fe10bfda502b78fdf7ba09b88..3fd73418df55f5b6c17b630d4ab8a4c6a23a5ce3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3431,15 +3431,17 @@ fn parse_pats(&mut self) -> PResult<'a, Vec
>> { let mut pats = Vec::new(); loop { pats.push(self.parse_pat()?); - if self.check(&token::BinOp(token::Or)) { self.bump();} - else { - // Accidental use of || instead of | inbetween patterns - if self.token == token::OrOr { - return Err(self.span_fatal_help( - self.span, "unexpected token `||` after pattern", - "did you mean to use `|` to specify multiple patterns instead?")); - } + if self.token == token::OrOr { + self.span_err_help(self.span, + "unexpected token `||` after pattern", + "did you mean to use `|` to specify multiple patterns?"); + self.bump(); + } + else if self.check(&token::BinOp(token::Or)) { + self.bump(); + } + else { return Ok(pats); } };