diff options
| author | Xiretza <xiretza@xiretza.xyz> | 2022-10-14 23:16:25 +0200 |
|---|---|---|
| committer | Xiretza <xiretza@xiretza.xyz> | 2023-02-01 21:50:34 +0100 |
| commit | 87ef37dbd7d26a40bb299aa151b5effdfcc1cec9 (patch) | |
| tree | b14aff290b47d456e664934a343aa4a75abb83b1 /compiler/rustc_parse/src/parser/stmt.rs | |
| parent | ac9c66bff549242b2b4784ff044ec6a4434c1b59 (diff) | |
rustc_parse: migrate more to diagnostic structs
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 58c7a398f14..647639b9b62 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -1,7 +1,7 @@ use super::attr::InnerAttrForbiddenReason; use super::diagnostics::AttemptLocalParseRecovery; use super::expr::LhsExpr; -use super::pat::RecoverComma; +use super::pat::{PatternLocation, RecoverComma}; use super::path::PathStyle; use super::TrailingToken; use super::{ @@ -275,7 +275,8 @@ impl<'a> Parser<'a> { } self.report_invalid_identifier_error()?; - let (pat, colon) = self.parse_pat_before_ty(None, RecoverComma::Yes, "`let` bindings")?; + let (pat, colon) = + self.parse_pat_before_ty(None, RecoverComma::Yes, PatternLocation::LetBinding)?; let (err, ty) = if colon { // Save the state of the parser before parsing type normally, in case there is a `:` |
