1
Fork 0

Suggests turbofish in patterns

This commit is contained in:
Mu001999 2023-08-01 23:30:40 +08:00
parent b969b830aa
commit 049c728c60
18 changed files with 101 additions and 50 deletions

View file

@ -805,6 +805,7 @@ impl<'a> Parser<'a> {
| token::DotDotDot | token::DotDotEq | token::DotDot // A range pattern.
| token::ModSep // A tuple / struct variant pattern.
| token::Not)) // A macro expanding to a pattern.
&& !(self.look_ahead(1, |t| t.kind == token::Lt) && self.look_ahead(2, |t| t.can_begin_type())) // May suggest the turbofish syntax for generics, only valid for recoveries.
}
/// Parses `ident` or `ident @ pat`.