diff options
| author | bors <bors@rust-lang.org> | 2020-10-30 10:01:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-30 10:01:49 +0000 |
| commit | 388ef349043f20a1a8a3011eaf49dee220485e0a (patch) | |
| tree | 0b2088eadcd8abe6302609612924f36fa7a88b0a /compiler/rustc_parse/src | |
| parent | 8df58ae03a8fda8ed126c02fbc16b530d18344df (diff) | |
| parent | 2471a7cdaabdc2cb910daba7cb536775e4d11acc (diff) | |
| download | rust-388ef349043f20a1a8a3011eaf49dee220485e0a.tar.gz rust-388ef349043f20a1a8a3011eaf49dee220485e0a.zip | |
Auto merge of #78562 - JohnTitor:rollup-otg906u, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #77334 (Reorder benches const variable) - #77888 (Simplify a nested bool match) - #77921 (f64: Refactor collapsible_if) - #78523 (Revert invalid `fn` return type parsing change) - #78524 (Avoid BorrowMutError with RUSTC_LOG=debug) - #78545 (Make anonymous binders start at 0) - #78554 (Improve wording of `core::ptr::drop_in_place` docs) - #78556 (Link to pass docs from NRVO module docs) Failed merges: - #78424 (Fix some more clippy warnings) r? `@ghost`
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 39d4875f37b..26492d92a77 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1666,19 +1666,10 @@ impl<'a> Parser<'a> { req_name: ReqName, ret_allow_plus: AllowPlus, ) -> PResult<'a, P<FnDecl>> { - let inputs = self.parse_fn_params(req_name)?; - let output = self.parse_ret_ty(ret_allow_plus, RecoverQPath::Yes)?; - - if let ast::FnRetTy::Ty(ty) = &output { - if let TyKind::Path(_, Path { segments, .. }) = &ty.kind { - if let [.., last] = &segments[..] { - // Detect and recover `fn foo() -> Vec<i32>> {}` - self.check_trailing_angle_brackets(last, &[&token::OpenDelim(token::Brace)]); - } - } - } - - Ok(P(FnDecl { inputs, output })) + Ok(P(FnDecl { + inputs: self.parse_fn_params(req_name)?, + output: self.parse_ret_ty(ret_allow_plus, RecoverQPath::Yes)?, + })) } /// Parses the parameter list of a function, including the `(` and `)` delimiters. |
