1
Fork 0

Gracefully handle confusing -> with : in function return type

This commit is contained in:
mibac138 2020-10-15 21:21:45 +02:00
parent 5404deeb64
commit 3548be94c0
18 changed files with 205 additions and 79 deletions

View file

@ -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 {