Gracefully handle mistyping -> as => in function return type
This commit is contained in:
parent
c4926d01ad
commit
5404deeb64
9 changed files with 96 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
use super::pat::{GateOr, PARAM_EXPECTED};
|
||||
use super::ty::{AllowPlus, RecoverQPath};
|
||||
use super::ty::{AllowPlus, RecoverFatArrow, RecoverQPath};
|
||||
use super::{BlockMode, Parser, PathStyle, Restrictions, TokenType};
|
||||
use super::{SemiColonMode, SeqSep, TokenExpectType};
|
||||
use crate::maybe_recover_from_interpolated_ty_qpath;
|
||||
|
@ -1647,7 +1647,7 @@ impl<'a> Parser<'a> {
|
|||
self.expect_or()?;
|
||||
args
|
||||
};
|
||||
let output = self.parse_ret_ty(AllowPlus::Yes, RecoverQPath::Yes)?;
|
||||
let output = self.parse_ret_ty(AllowPlus::Yes, RecoverQPath::Yes, RecoverFatArrow::Yes)?;
|
||||
|
||||
Ok(P(FnDecl { inputs, output }))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue