diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index e6e98a35d6e..a62b9260057 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -259,7 +259,7 @@ pub impl Parser { fn try_parse_obsolete_struct_ctor(&self) -> bool { if self.eat_obsolete_ident("new") { self.obsolete(*self.last_span, ObsoleteStructCtor); - self.parse_fn_decl(|p| p.parse_arg()); + self.parse_fn_decl(); self.parse_block(); true } else { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9ebc6af04a9..0afef442efc 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2844,7 +2844,8 @@ pub impl Parser { (lifetimes, opt_vec::take_vec(result)) } - fn parse_fn_decl(&self, parse_arg_fn: &fn(&Parser) -> arg_or_capture_item) + // parse the argument list and result type of a function declaration + fn parse_fn_decl(&self) -> fn_decl { let args_or_capture_items: ~[arg_or_capture_item] = @@ -2852,7 +2853,7 @@ pub impl Parser { &token::LPAREN, &token::RPAREN, seq_sep_trailing_disallowed(token::COMMA), - parse_arg_fn + |p| p.parse_arg() ); let inputs = either::lefts(args_or_capture_items); @@ -3081,7 +3082,7 @@ pub impl Parser { // parse an item-position function declaration. fn parse_item_fn(&self, purity: purity, abis: AbiSet) -> item_info { let (ident, generics) = self.parse_fn_header(); - let decl = self.parse_fn_decl(|p| p.parse_arg()); + let decl = self.parse_fn_decl(); let (inner_attrs, body) = self.parse_inner_attrs_and_block(true); (ident, item_fn(decl, purity, abis, generics, body), @@ -3593,7 +3594,7 @@ pub impl Parser { let vis = self.parse_visibility(); let purity = self.parse_fn_purity(); let (ident, generics) = self.parse_fn_header(); - let decl = self.parse_fn_decl(|p| p.parse_arg()); + let decl = self.parse_fn_decl(); let hi = self.span.hi; self.expect(&token::SEMI); @ast::foreign_item { ident: ident,