@@ -1362,7 +1362,7 @@ impl<'a> Parser<'a> {
1362
1362
1363
1363
self . expect_keyword ( keywords:: Fn ) ?;
1364
1364
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 ) ?;
1366
1366
let decl = P ( FnDecl {
1367
1367
inputs,
1368
1368
output : ret_ty,
@@ -1501,9 +1501,9 @@ impl<'a> Parser<'a> {
1501
1501
}
1502
1502
1503
1503
/// 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 > {
1505
1505
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 ) ?) )
1507
1507
} else {
1508
1508
Ok ( FunctionRetTy :: Default ( self . span . with_hi ( self . span . lo ( ) ) ) )
1509
1509
}
@@ -4893,7 +4893,7 @@ impl<'a> Parser<'a> {
4893
4893
pub fn parse_fn_decl ( & mut self , allow_variadic : bool ) -> PResult < ' a , P < FnDecl > > {
4894
4894
4895
4895
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 ) ?;
4897
4897
4898
4898
Ok ( P ( FnDecl {
4899
4899
inputs : args,
@@ -5034,7 +5034,7 @@ impl<'a> Parser<'a> {
5034
5034
self . expect ( & token:: CloseDelim ( token:: Paren ) ) ?;
5035
5035
Ok ( P ( FnDecl {
5036
5036
inputs : fn_inputs,
5037
- output : self . parse_ret_ty ( ) ?,
5037
+ output : self . parse_ret_ty ( true ) ?,
5038
5038
variadic : false
5039
5039
} ) )
5040
5040
}
@@ -5056,7 +5056,7 @@ impl<'a> Parser<'a> {
5056
5056
args
5057
5057
}
5058
5058
} ;
5059
- let output = self . parse_ret_ty ( ) ?;
5059
+ let output = self . parse_ret_ty ( true ) ?;
5060
5060
5061
5061
Ok ( P ( FnDecl {
5062
5062
inputs : inputs_captures,
0 commit comments