diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-01 12:52:59 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-12 17:54:49 +0100 |
| commit | 404013e015d9a9f4835cda47e56aab5223f278ed (patch) | |
| tree | f0ff398b431298f2fa0a770cde34826c8ef88e37 /src | |
| parent | fa828d7a0567cf833a8da9b10cc9936b3e9423dd (diff) | |
| download | rust-404013e015d9a9f4835cda47e56aab5223f278ed.tar.gz rust-404013e015d9a9f4835cda47e56aab5223f278ed.zip | |
Leave a FIXME re. `allow_plus`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_parse/parser/ty.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs index 84ffef68e9a..33d7c878e88 100644 --- a/src/librustc_parse/parser/ty.rs +++ b/src/librustc_parse/parser/ty.rs @@ -42,11 +42,12 @@ impl<'a> Parser<'a> { /// Parses an optional return type `[ -> TY ]` in a function declaration. pub(super) fn parse_ret_ty(&mut self, allow_plus: bool) -> PResult<'a, FunctionRetTy> { - if self.eat(&token::RArrow) { - Ok(FunctionRetTy::Ty(self.parse_ty_common(allow_plus, true, false)?)) + Ok(if self.eat(&token::RArrow) { + // FIXME(Centril): Can we unconditionally `allow_plus`? + FunctionRetTy::Ty(self.parse_ty_common(allow_plus, true, false)?) } else { - Ok(FunctionRetTy::Default(self.token.span.shrink_to_lo())) - } + FunctionRetTy::Default(self.token.span.shrink_to_lo()) + }) } pub(super) fn parse_ty_common(&mut self, allow_plus: bool, allow_qpath_recovery: bool, |
