@@ -1362,7 +1362,7 @@ impl<'a> Parser<'a> {
13621362
13631363 self . expect_keyword ( keywords:: Fn ) ?;
13641364 let ( inputs, variadic) = self . parse_fn_args ( false , true ) ?;
1365- let ret_ty = self . parse_ret_ty ( ) ?;
1365+ let ret_ty = self . parse_ret_ty ( false ) ?;
13661366 let decl = P ( FnDecl {
13671367 inputs,
13681368 output : ret_ty,
@@ -1501,9 +1501,9 @@ impl<'a> Parser<'a> {
15011501 }
15021502
15031503 /// Parse optional return type [ -> TY ] in function decl
1504- pub fn parse_ret_ty ( & mut self ) -> PResult < ' a , FunctionRetTy > {
1504+ fn parse_ret_ty ( & mut self , allow_plus : bool ) -> PResult < ' a , FunctionRetTy > {
15051505 if self . eat ( & token:: RArrow ) {
1506- Ok ( FunctionRetTy :: Ty ( self . parse_ty_no_plus ( ) ?) )
1506+ Ok ( FunctionRetTy :: Ty ( self . parse_ty_common ( allow_plus , true ) ?) )
15071507 } else {
15081508 Ok ( FunctionRetTy :: Default ( self . span . with_hi ( self . span . lo ( ) ) ) )
15091509 }
@@ -4893,7 +4893,7 @@ impl<'a> Parser<'a> {
48934893 pub fn parse_fn_decl ( & mut self , allow_variadic : bool ) -> PResult < ' a , P < FnDecl > > {
48944894
48954895 let ( args, variadic) = self . parse_fn_args ( true , allow_variadic) ?;
4896- let ret_ty = self . parse_ret_ty ( ) ?;
4896+ let ret_ty = self . parse_ret_ty ( true ) ?;
48974897
48984898 Ok ( P ( FnDecl {
48994899 inputs : args,
@@ -5034,7 +5034,7 @@ impl<'a> Parser<'a> {
50345034 self . expect ( & token:: CloseDelim ( token:: Paren ) ) ?;
50355035 Ok ( P ( FnDecl {
50365036 inputs : fn_inputs,
5037- output : self . parse_ret_ty ( ) ?,
5037+ output : self . parse_ret_ty ( true ) ?,
50385038 variadic : false
50395039 } ) )
50405040 }
@@ -5056,7 +5056,7 @@ impl<'a> Parser<'a> {
50565056 args
50575057 }
50585058 } ;
5059- let output = self . parse_ret_ty ( ) ?;
5059+ let output = self . parse_ret_ty ( true ) ?;
50605060
50615061 Ok ( P ( FnDecl {
50625062 inputs : inputs_captures,
0 commit comments