summaryrefslogtreecommitdiff
path: root/compiler/rustc_parse/src/parser/generics.rs
diff options
context:
space:
mode:
authormibac138 <5672750+mibac138@users.noreply.github.com>2020-10-15 21:21:45 +0200
committermibac138 <5672750+mibac138@users.noreply.github.com>2020-12-03 18:19:42 +0100
commit3548be94c03fd6d1c11afd6af9c884f398a6489e (patch)
tree86c5373565d742f32daf339ea8645c951697de37 /compiler/rustc_parse/src/parser/generics.rs
parent5404deeb64f4449079f5165ace6bfa1e52ca4b33 (diff)
downloadrust-3548be94c03fd6d1c11afd6af9c884f398a6489e.tar.gz
Gracefully handle confusing -> with : in function return type
Diffstat (limited to 'compiler/rustc_parse/src/parser/generics.rs')
-rw-r--r--compiler/rustc_parse/src/parser/generics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs
index dd99a7587dd..ed8d4f78426 100644
--- a/compiler/rustc_parse/src/parser/generics.rs
+++ b/compiler/rustc_parse/src/parser/generics.rs
@@ -240,7 +240,7 @@ impl<'a> Parser<'a> {
// Parse type with mandatory colon and (possibly empty) bounds,
// or with mandatory equality sign and the second type.
- let ty = self.parse_ty()?;
+ let ty = self.parse_ty_for_where_clause()?;
if self.eat(&token::Colon) {
let bounds = self.parse_generic_bounds(Some(self.prev_token.span))?;
Ok(ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate {