Suggests turbofish in patterns
This commit is contained in:
parent
b969b830aa
commit
049c728c60
18 changed files with 101 additions and 50 deletions
|
@ -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`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue