diff options
| author | bors <bors@rust-lang.org> | 2020-12-19 01:47:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-19 01:47:05 +0000 |
| commit | d1741e59cb87d3c8c794eebf6d5430d1b383f51f (patch) | |
| tree | db1f9082578874b99629815bde7a05f3d4a12a03 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 50a90975c0f78219db45d3bee0676a22695ec103 (diff) | |
| parent | e916641fd35bddabc8b018a5e51fe23b93875c66 (diff) | |
| download | rust-d1741e59cb87d3c8c794eebf6d5430d1b383f51f.tar.gz rust-d1741e59cb87d3c8c794eebf6d5430d1b383f51f.zip | |
Auto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwco
Gracefully handle mistyping -> as => in function return type Fixes #77019
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 93be478fc8c..4d2167442be 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, RecoverQPath, RecoverReturnSign}; use super::{BlockMode, Parser, PathStyle, Restrictions, TokenType}; use super::{SemiColonMode, SeqSep, TokenExpectType}; use crate::maybe_recover_from_interpolated_ty_qpath; @@ -1647,7 +1647,8 @@ 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, RecoverReturnSign::Yes)?; Ok(P(FnDecl { inputs, output })) } |
