Gracefully handle mistyping -> as => in function return type
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use super::ty::{AllowPlus, RecoverQPath};
|
||||
use super::ty::{AllowPlus, RecoverFatArrow, RecoverQPath};
|
||||
use super::{Parser, TokenType};
|
||||
use crate::maybe_whole;
|
||||
use rustc_ast::ptr::P;
|
||||
@@ -231,7 +231,8 @@ impl<'a> Parser<'a> {
|
||||
// `(T, U) -> R`
|
||||
let (inputs, _) = self.parse_paren_comma_seq(|p| p.parse_ty())?;
|
||||
let span = ident.span.to(self.prev_token.span);
|
||||
let output = self.parse_ret_ty(AllowPlus::No, RecoverQPath::No)?;
|
||||
let output =
|
||||
self.parse_ret_ty(AllowPlus::No, RecoverQPath::No, RecoverFatArrow::No)?;
|
||||
ParenthesizedArgs { inputs, output, span }.into()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user