diff options
| author | bors <bors@rust-lang.org> | 2021-02-18 01:31:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-18 01:31:10 +0000 |
| commit | cbf666dbc1409f1afbe866ba03755e44dbd1927c (patch) | |
| tree | 732f41658ac528cc398e033decfc6ad75909832f /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 93f6a4b9d85b7eef71e17d95c113f5834238b574 (diff) | |
| parent | f7501b6d5ec7b72a696d4f7e03fbb47116c7b71f (diff) | |
| download | rust-cbf666dbc1409f1afbe866ba03755e44dbd1927c.tar.gz rust-cbf666dbc1409f1afbe866ba03755e44dbd1927c.zip | |
Auto merge of #82241 - Dylan-DPC:rollup-munmzg5, r=Dylan-DPC
Rollup of 8 pull requests Successful merges: - #77728 (Expose force_quotes on Windows.) - #80572 (Add a `Result::into_ok_or_err` method to extract a `T` from `Result<T, T>`) - #81860 (Fix SourceMap::start_point) - #81869 (Simplify pattern grammar, improve or-pattern diagnostics) - #81898 (Fix debug information for function arguments of type &str or slice.) - #81972 (Placeholder lifetime error cleanup) - #82007 (Implement reborrow for closure captures) - #82021 (Spell out nested Self type in lint message) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 20430ece05b..59fd060aa24 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1726,7 +1726,7 @@ impl<'a> Parser<'a> { let lo = self.token.span; let attrs = self.parse_outer_attributes()?; self.collect_tokens_trailing_token(attrs, ForceCollect::No, |this, attrs| { - let pat = this.parse_pat(PARAM_EXPECTED)?; + let pat = this.parse_pat_no_top_alt(PARAM_EXPECTED)?; let ty = if this.eat(&token::Colon) { this.parse_ty()? } else { @@ -1803,7 +1803,7 @@ impl<'a> Parser<'a> { /// The `let` token has already been eaten. fn parse_let_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>> { let lo = self.prev_token.span; - let pat = self.parse_top_pat(GateOr::No, RecoverComma::Yes)?; + let pat = self.parse_pat_allow_top_alt(None, GateOr::No, RecoverComma::Yes)?; self.expect(&token::Eq)?; let expr = self.with_res(self.restrictions | Restrictions::NO_STRUCT_LITERAL, |this| { this.parse_assoc_expr_with(1 + prec_let_scrutinee_needs_par(), None.into()) @@ -1866,7 +1866,7 @@ impl<'a> Parser<'a> { _ => None, }; - let pat = self.parse_top_pat(GateOr::Yes, RecoverComma::Yes)?; + let pat = self.parse_pat_allow_top_alt(None, GateOr::Yes, RecoverComma::Yes)?; if !self.eat_keyword(kw::In) { self.error_missing_in_for_loop(); } @@ -1977,7 +1977,7 @@ impl<'a> Parser<'a> { let attrs = self.parse_outer_attributes()?; self.collect_tokens_trailing_token(attrs, ForceCollect::No, |this, attrs| { let lo = this.token.span; - let pat = this.parse_top_pat(GateOr::No, RecoverComma::Yes)?; + let pat = this.parse_pat_allow_top_alt(None, GateOr::No, RecoverComma::Yes)?; let guard = if this.eat_keyword(kw::If) { let if_span = this.prev_token.span; let cond = this.parse_expr()?; |
