diff options
| author | bors <bors@rust-lang.org> | 2019-08-27 00:07:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-27 00:07:38 +0000 |
| commit | 0444b9f66acb5da23dc816e0d8eb59623ba9ea50 (patch) | |
| tree | 3121696aba5740b9bb02879924f6997b51b6785e /src/libsyntax/parse/parser.rs | |
| parent | 9b91b9c10e3c87ed333a1e34c4f46ed68f1eee06 (diff) | |
| parent | 9c5c124d788962a65198e1e45987b094fd356914 (diff) | |
| download | rust-0444b9f66acb5da23dc816e0d8eb59623ba9ea50.tar.gz rust-0444b9f66acb5da23dc816e0d8eb59623ba9ea50.zip | |
Auto merge of #63926 - Centril:rollup-6kckn9n, r=Centril
Rollup of 6 pull requests Successful merges: - #63317 (Do not complain about unused code when used in `impl` `Self` type) - #63693 (Fully implement or-pattern parsing) - #63836 (VxWorks does not provide a way to set the task name except at creation time) - #63845 (Removed a confusing FnOnce example) - #63855 (Refactor feature gates) - #63921 (add link to FileCheck docs) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 89725d8b339..25ad2d4404c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -971,15 +971,12 @@ impl<'a> Parser<'a> { /// Skips unexpected attributes and doc comments in this position and emits an appropriate /// error. /// This version of parse arg doesn't necessarily require identifier names. - fn parse_arg_general<F>( + fn parse_arg_general( &mut self, is_trait_item: bool, allow_c_variadic: bool, - is_name_required: F, - ) -> PResult<'a, Arg> - where - F: Fn(&token::Token) -> bool - { + is_name_required: impl Fn(&token::Token) -> bool, + ) -> PResult<'a, Arg> { let lo = self.token.span; let attrs = self.parse_arg_attributes()?; if let Some(mut arg) = self.parse_self_arg()? { @@ -991,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, |
