about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-25 04:39:28 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-08-25 05:45:19 +0200
commit1caaa40768fecb91b322b1e1befc91c54b56817c (patch)
treeee0854e5e1c7602db949809e6542cdb4396a61c2 /src/libsyntax/parse/parser.rs
parent083963e58c752f1a51b67d65dc6a207bf69f1d64 (diff)
downloadrust-1caaa40768fecb91b322b1e1befc91c54b56817c.tar.gz
rust-1caaa40768fecb91b322b1e1befc91c54b56817c.zip
parser: gracefully handle `fn foo(A | B: type)`.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 002e9bccec7..25ad2d4404c 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -988,7 +988,7 @@ impl<'a> Parser<'a> {
         let (pat, ty) = if is_name_required || self.is_named_argument() {
             debug!("parse_arg_general parse_pat (is_name_required:{})", is_name_required);
 
-            let pat = self.parse_pat(Some("argument name"))?;
+            let pat = self.parse_fn_param_pat()?;
             if let Err(mut err) = self.expect(&token::Colon) {
                 if let Some(ident) = self.argument_without_type(
                     &mut err,