about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/path.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-19 01:47:05 +0000
committerbors <bors@rust-lang.org>2020-12-19 01:47:05 +0000
commitd1741e59cb87d3c8c794eebf6d5430d1b383f51f (patch)
treedb1f9082578874b99629815bde7a05f3d4a12a03 /compiler/rustc_parse/src/parser/path.rs
parent50a90975c0f78219db45d3bee0676a22695ec103 (diff)
parente916641fd35bddabc8b018a5e51fe23b93875c66 (diff)
downloadrust-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/path.rs')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index 17e5bcf7605..4510e86e034 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -1,4 +1,4 @@
-use super::ty::{AllowPlus, RecoverQPath};
+use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
 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, RecoverReturnSign::No)?;
                     ParenthesizedArgs { inputs, output, span }.into()
                 };