Don't make pattern nonterminals match statement nonterminals
This commit is contained in:
parent
22572d0994
commit
c61f85b6dd
5 changed files with 65 additions and 42 deletions
|
@ -378,7 +378,10 @@ impl<'a> Parser<'a> {
|
|||
if self.may_recover()
|
||||
&& prev_token_before_parsing == token::PathSep
|
||||
&& (style == PathStyle::Expr && self.token.can_begin_expr()
|
||||
|| style == PathStyle::Pat && self.token.can_begin_pattern())
|
||||
|| style == PathStyle::Pat
|
||||
&& self.token.can_begin_pattern(token::NtPatKind::PatParam {
|
||||
inferred: false,
|
||||
}))
|
||||
{
|
||||
snapshot = Some(self.create_snapshot_for_diagnostic());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue