diff options
| author | mark <markm@cs.wisc.edu> | 2020-11-10 18:00:53 -0600 |
|---|---|---|
| committer | mark <markm@cs.wisc.edu> | 2020-12-19 07:13:36 -0600 |
| commit | 1a7d00a529503ac38a6b1ae28e8e779e434e02e0 (patch) | |
| tree | 322ac3ba9ec48dc477bb84fea01b6ee0f74f5bf4 /compiler/rustc_parse/src/parser/stmt.rs | |
| parent | e461b8137f8f7277147e3ec8ec0b7f0f31d32d0b (diff) | |
| download | rust-1a7d00a529503ac38a6b1ae28e8e779e434e02e0.tar.gz rust-1a7d00a529503ac38a6b1ae28e8e779e434e02e0.zip | |
implement edition-specific :pat behavior for 2015/18
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index e974556f43a..2942747991a 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -1,7 +1,7 @@ use super::attr::DEFAULT_INNER_ATTR_FORBIDDEN; use super::diagnostics::{AttemptLocalParseRecovery, Error}; use super::expr::LhsExpr; -use super::pat::GateOr; +use super::pat::{GateOr, RecoverComma}; use super::path::PathStyle; use super::{BlockMode, Parser, Restrictions, SemiColonMode}; use crate::maybe_whole; @@ -185,7 +185,7 @@ impl<'a> Parser<'a> { /// Parses a local variable declaration. fn parse_local(&mut self, attrs: AttrVec) -> PResult<'a, P<Local>> { let lo = self.prev_token.span; - let pat = self.parse_top_pat(GateOr::Yes)?; + let pat = self.parse_top_pat(GateOr::Yes, RecoverComma::Yes)?; let (err, ty) = if self.eat(&token::Colon) { // Save the state of the parser before parsing type normally, in case there is a `:` |
