diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-25 01:50:21 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-25 01:50:21 +0200 |
| commit | 083963e58c752f1a51b67d65dc6a207bf69f1d64 (patch) | |
| tree | a5274c7e6ffaa7f09d21d0f5c1d8782dfb2c5e36 /src/libsyntax/parse | |
| parent | 1202cb0e2b168b0a913b33e3cb3c1d9339683e28 (diff) | |
| download | rust-083963e58c752f1a51b67d65dc6a207bf69f1d64.tar.gz rust-083963e58c752f1a51b67d65dc6a207bf69f1d64.zip | |
parser: 'while parsing this or-pattern...'
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser/pat.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index 7c09dc4e566..a0278fa4077 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -81,7 +81,10 @@ impl<'a> Parser<'a> { let lo = first_pat.span; let mut pats = vec![first_pat]; while self.eat_or_separator() { - let pat = self.parse_pat(None)?; + let pat = self.parse_pat(None).map_err(|mut err| { + err.span_label(lo, "while parsing this or-pattern staring here"); + err + })?; self.maybe_recover_unexpected_comma(pat.span, top_level)?; pats.push(pat); } |
