diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-20 07:21:27 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-21 10:18:34 +1100 |
| commit | c14d9ae23e3b940c757c0775c1fc9ae21c9dcc29 (patch) | |
| tree | 30eae604bd5ad4112cb379fa7061bf4039c2563e /compiler/rustc_parse/src | |
| parent | 095722214d262981e44abd62b6abb2cc790d51c0 (diff) | |
| download | rust-c14d9ae23e3b940c757c0775c1fc9ae21c9dcc29.tar.gz rust-c14d9ae23e3b940c757c0775c1fc9ae21c9dcc29.zip | |
Fix some formatting.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/nonterminal.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/nonterminal.rs b/compiler/rustc_parse/src/parser/nonterminal.rs index f1572a18a8b..1cba7107e9a 100644 --- a/compiler/rustc_parse/src/parser/nonterminal.rs +++ b/compiler/rustc_parse/src/parser/nonterminal.rs @@ -66,15 +66,14 @@ impl<'a> Parser<'a> { token::Interpolated(nt) => may_be_ident(&nt.0), _ => false, }, - NonterminalKind::PatParam { .. } | NonterminalKind::PatWithOr => { - match &token.kind { + NonterminalKind::PatParam { .. } | NonterminalKind::PatWithOr => match &token.kind { token::Ident(..) | // box, ref, mut, and other identifiers (can stricten) token::OpenDelim(Delimiter::Parenthesis) | // tuple pattern token::OpenDelim(Delimiter::Bracket) | // slice pattern token::BinOp(token::And) | // reference token::BinOp(token::Minus) | // negative literal token::AndAnd | // double reference - token::Literal(_) | // literal + token::Literal(_) | // literal token::DotDot | // range pattern (future compat) token::DotDotDot | // range pattern (future compat) token::ModSep | // path @@ -84,8 +83,7 @@ impl<'a> Parser<'a> { token::BinOp(token::Or) => matches!(kind, NonterminalKind::PatWithOr), token::Interpolated(nt) => may_be_ident(&nt.0), _ => false, - } - } + }, NonterminalKind::Lifetime => match &token.kind { token::Lifetime(_) => true, token::Interpolated(nt) => { |
