1
Fork 0

Gracefully handle confusing -> with : in function return type

This commit is contained in:
mibac138 2020-10-15 21:21:45 +02:00
parent 5404deeb64
commit 3548be94c0
18 changed files with 205 additions and 79 deletions

View file

@ -1,4 +1,4 @@
use super::ty::{AllowPlus, RecoverFatArrow, RecoverQPath};
use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
use super::{Parser, TokenType};
use crate::maybe_whole;
use rustc_ast::ptr::P;
@ -232,7 +232,7 @@ impl<'a> Parser<'a> {
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, RecoverFatArrow::No)?;
self.parse_ret_ty(AllowPlus::No, RecoverQPath::No, RecoverReturnSign::No)?;
ParenthesizedArgs { inputs, output, span }.into()
};