@@ -1310,7 +1310,7 @@ impl<'a> Parser<'a> {
13101310 let ident = p. parse_ident ( ) ?;
13111311 let mut generics = p. parse_generics ( ) ?;
13121312
1313- let ( d , self_shortcut ) = p. parse_fn_decl_with_self ( |p : & mut Parser < ' a > |{
1313+ let d = p. parse_fn_decl_with_self ( |p : & mut Parser < ' a > |{
13141314 // This is somewhat dubious; We don't want to allow
13151315 // argument names to be left off if there is a
13161316 // definition...
@@ -1324,7 +1324,6 @@ impl<'a> Parser<'a> {
13241324 decl : d,
13251325 generics : generics,
13261326 abi : abi,
1327- self_shortcut : self_shortcut,
13281327 } ;
13291328
13301329 let body = match p. token {
@@ -4617,7 +4616,7 @@ impl<'a> Parser<'a> {
46174616 }
46184617
46194618 /// Returns the parsed optional self argument and whether a self shortcut was used.
4620- fn parse_self_arg ( & mut self ) -> PResult < ' a , ( Option < Arg > , bool ) > {
4619+ fn parse_self_arg ( & mut self ) -> PResult < ' a , Option < Arg > > {
46214620 let expect_ident = |this : & mut Self | match this. token {
46224621 // Preserve hygienic context.
46234622 token:: Ident ( ident) => { this. bump ( ) ; codemap:: respan ( this. last_span , ident) }
@@ -4656,7 +4655,7 @@ impl<'a> Parser<'a> {
46564655 self . bump ( ) ;
46574656 ( SelfKind :: Region ( Some ( lt) , Mutability :: Mutable ) , expect_ident ( self ) )
46584657 } else {
4659- return Ok ( ( None , false ) ) ;
4658+ return Ok ( None ) ;
46604659 }
46614660 }
46624661 token:: BinOp ( token:: Star ) => {
@@ -4676,7 +4675,7 @@ impl<'a> Parser<'a> {
46764675 self . span_err ( self . span , "cannot pass `self` by raw pointer" ) ;
46774676 ( SelfKind :: Value ( Mutability :: Immutable ) , expect_ident ( self ) )
46784677 } else {
4679- return Ok ( ( None , false ) ) ;
4678+ return Ok ( None ) ;
46804679 }
46814680 }
46824681 token:: Ident ( ..) => {
@@ -4703,27 +4702,24 @@ impl<'a> Parser<'a> {
47034702 ( SelfKind :: Value ( Mutability :: Mutable ) , eself_ident)
47044703 }
47054704 } else {
4706- return Ok ( ( None , false ) ) ;
4705+ return Ok ( None ) ;
47074706 }
47084707 }
4709- _ => return Ok ( ( None , false ) ) ,
4708+ _ => return Ok ( None ) ,
47104709 } ;
47114710
4712- let self_shortcut = if let SelfKind :: Explicit ( ..) = eself { false } else { true } ;
47134711 let eself = codemap:: respan ( mk_sp ( eself_lo, self . last_span . hi ) , eself) ;
4714- Ok ( ( Some ( Arg :: from_self ( eself, eself_ident) ) , self_shortcut ) )
4712+ Ok ( Some ( Arg :: from_self ( eself, eself_ident) ) )
47154713 }
47164714
47174715 /// Parse the parameter list and result type of a function that may have a `self` parameter.
4718- fn parse_fn_decl_with_self < F > ( & mut self ,
4719- parse_arg_fn : F )
4720- -> PResult < ' a , ( P < FnDecl > , bool ) >
4716+ fn parse_fn_decl_with_self < F > ( & mut self , parse_arg_fn : F ) -> PResult < ' a , P < FnDecl > >
47214717 where F : FnMut ( & mut Parser < ' a > ) -> PResult < ' a , Arg > ,
47224718 {
47234719 self . expect ( & token:: OpenDelim ( token:: Paren ) ) ?;
47244720
47254721 // Parse optional self argument
4726- let ( self_arg, self_shortcut ) = self . parse_self_arg ( ) ?;
4722+ let self_arg = self . parse_self_arg ( ) ?;
47274723
47284724 // Parse the rest of the function parameter list.
47294725 let sep = SeqSep :: trailing_allowed ( token:: Comma ) ;
@@ -4745,11 +4741,11 @@ impl<'a> Parser<'a> {
47454741
47464742 // Parse closing paren and return type.
47474743 self . expect ( & token:: CloseDelim ( token:: Paren ) ) ?;
4748- Ok ( ( P ( FnDecl {
4744+ Ok ( P ( FnDecl {
47494745 inputs : fn_inputs,
47504746 output : self . parse_ret_ty ( ) ?,
47514747 variadic : false
4752- } ) , self_shortcut ) )
4748+ } ) )
47534749 }
47544750
47554751 // parse the |arg, arg| header on a lambda
@@ -4942,13 +4938,12 @@ impl<'a> Parser<'a> {
49424938 let ( constness, unsafety, abi) = self . parse_fn_front_matter ( ) ?;
49434939 let ident = self . parse_ident ( ) ?;
49444940 let mut generics = self . parse_generics ( ) ?;
4945- let ( decl, self_shortcut ) = self . parse_fn_decl_with_self ( |p| p. parse_arg ( ) ) ?;
4941+ let decl = self . parse_fn_decl_with_self ( |p| p. parse_arg ( ) ) ?;
49464942 generics. where_clause = self . parse_where_clause ( ) ?;
49474943 let ( inner_attrs, body) = self . parse_inner_attrs_and_block ( ) ?;
49484944 Ok ( ( ident, inner_attrs, ast:: ImplItemKind :: Method ( ast:: MethodSig {
49494945 generics : generics,
49504946 abi : abi,
4951- self_shortcut : self_shortcut,
49524947 unsafety : unsafety,
49534948 constness : constness,
49544949 decl : decl
0 commit comments