diff options
| author | mibac138 <5672750+mibac138@users.noreply.github.com> | 2020-10-14 22:27:48 +0200 |
|---|---|---|
| committer | mibac138 <5672750+mibac138@users.noreply.github.com> | 2020-12-01 12:12:48 +0100 |
| commit | 5404deeb64f4449079f5165ace6bfa1e52ca4b33 (patch) | |
| tree | b4a0cee6781d257ae05ebaf6d8a6cdffc1104946 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | c4926d01ada661d4fbffb0e5b1708ae5463d47b3 (diff) | |
| download | rust-5404deeb64f4449079f5165ace6bfa1e52ca4b33.tar.gz rust-5404deeb64f4449079f5165ace6bfa1e52ca4b33.zip | |
Gracefully handle mistyping -> as => in function return type
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 93be478fc8c..790a0c867af 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -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 })) } |
