Skip to content

Commit

Permalink
Remove extra Meta check
Browse files Browse the repository at this point in the history
  • Loading branch information
carbotaniuman committed May 4, 2024
1 parent 8d5667d commit 61fe268
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions compiler/rustc_parse/src/parser/nonterminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,13 @@ impl<'a> Parser<'a> {
},
_ => false,
},
NonterminalKind::Meta => match &token.kind {
token::PathSep | token::Ident(..) => true,
token::Interpolated(nt) => may_be_ident(&nt.0),
_ => token.is_keyword(kw::Unsafe),
},
NonterminalKind::Path | NonterminalKind::Meta2021 => match &token.kind {
token::PathSep | token::Ident(..) => true,
token::Interpolated(nt) => may_be_ident(&nt.0),
_ => false,
},
NonterminalKind::Path | NonterminalKind::Meta | NonterminalKind::Meta2021 => {
match &token.kind {
token::PathSep | token::Ident(..) => true,
token::Interpolated(nt) => may_be_ident(&nt.0),
_ => false,
}
}
NonterminalKind::PatParam { .. } | NonterminalKind::PatWithOr => match &token.kind {
token::Ident(..) | // box, ref, mut, and other identifiers (can stricten)
token::OpenDelim(Delimiter::Parenthesis) | // tuple pattern
Expand Down

0 comments on commit 61fe268

Please sign in to comment.