Skip to content

Commit bb992a2

Browse files
committed
revert unnecessary changes
1 parent 33d9f1e commit bb992a2

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

compiler/rustc_ast/src/token.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ impl Token {
551551
Literal(..) | BinOp(Minus) => true,
552552
Ident(name, false) if name.is_bool_lit() => true,
553553
Interpolated(ref nt) => match &nt.0 {
554-
NtLiteral(..) => true,
554+
NtLiteral(_) => true,
555555
NtExpr(e) => match &e.kind {
556556
ast::ExprKind::Lit(_) => true,
557557
ast::ExprKind::Unary(ast::UnOp::Neg, e) => {
@@ -628,7 +628,7 @@ impl Token {
628628

629629
/// Returns `true` if the token is an interpolated path.
630630
fn is_path(&self) -> bool {
631-
if let Interpolated(nt) = &self.kind && let NtPath(..) = &nt.0 {
631+
if let Interpolated(nt) = &self.kind && let NtPath(_) = &nt.0 {
632632
return true;
633633
}
634634

@@ -640,7 +640,7 @@ impl Token {
640640
/// (which happens while parsing the result of macro expansion)?
641641
pub fn is_whole_expr(&self) -> bool {
642642
if let Interpolated(nt) = &self.kind
643-
&& let NtExpr(..) | NtLiteral(..) | NtPath(..) | NtBlock(..) = &nt.0
643+
&& let NtExpr(_) | NtLiteral(_) | NtPath(_) | NtBlock(_) = &nt.0
644644
{
645645
return true;
646646
}

compiler/rustc_parse/src/parser/nonterminal.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ impl<'a> Parser<'a> {
2121
/// Checks whether the non-terminal may contain a single (non-keyword) identifier.
2222
fn may_be_ident(nt: &token::Nonterminal) -> bool {
2323
match nt {
24-
NtStmt(..)
25-
| NtPat(..)
26-
| NtExpr(..)
27-
| NtTy(..)
24+
NtStmt(_)
25+
| NtPat(_)
26+
| NtExpr(_)
27+
| NtTy(_)
2828
| NtIdent(..)
29-
| NtLiteral(..) // `true`, `false`
30-
| NtMeta(..)
31-
| NtPath(..) => true,
29+
| NtLiteral(_) // `true`, `false`
30+
| NtMeta(_)
31+
| NtPath(_) => true,
3232

33-
NtItem(..)
34-
| NtBlock(..)
35-
| NtVis(..)
36-
| NtLifetime(..) => false,
33+
NtItem(_)
34+
| NtBlock(_)
35+
| NtVis(_)
36+
| NtLifetime(_) => false,
3737
}
3838
}
3939

@@ -50,15 +50,15 @@ impl<'a> Parser<'a> {
5050
NonterminalKind::Literal => token.can_begin_literal_maybe_minus(),
5151
NonterminalKind::Vis => match token.kind {
5252
// The follow-set of :vis + "priv" keyword + interpolated
53-
token::Comma | token::Ident(..) | token::Interpolated(..) => true,
53+
token::Comma | token::Ident(..) | token::Interpolated(_) => true,
5454
_ => token.can_begin_type(),
5555
},
5656
NonterminalKind::Block => match &token.kind {
5757
token::OpenDelim(Delimiter::Brace) => true,
5858
token::Interpolated(nt) => match &nt.0 {
59-
NtBlock(..) | NtLifetime(..) | NtStmt(..) | NtExpr(..) | NtLiteral(..) => true,
60-
NtItem(..) | NtPat(..) | NtTy(..) | NtIdent(..) | NtMeta(..) | NtPath(..)
61-
| NtVis(..) => false,
59+
NtBlock(_) | NtLifetime(_) | NtStmt(_) | NtExpr(_) | NtLiteral(_) => true,
60+
NtItem(_) | NtPat(_) | NtTy(_) | NtIdent(..) | NtMeta(_) | NtPath(_)
61+
| NtVis(_) => false,
6262
},
6363
_ => false,
6464
},
@@ -75,7 +75,7 @@ impl<'a> Parser<'a> {
7575
token::BinOp(token::And) | // reference
7676
token::BinOp(token::Minus) | // negative literal
7777
token::AndAnd | // double reference
78-
token::Literal(..) | // literal
78+
token::Literal(_) | // literal
7979
token::DotDot | // range pattern (future compat)
8080
token::DotDotDot | // range pattern (future compat)
8181
token::ModSep | // path
@@ -90,7 +90,7 @@ impl<'a> Parser<'a> {
9090
NonterminalKind::Lifetime => match &token.kind {
9191
token::Lifetime(_) => true,
9292
token::Interpolated(nt) => {
93-
matches!(&nt.0, NtLifetime(..))
93+
matches!(&nt.0, NtLifetime(_))
9494
}
9595
_ => false,
9696
},

0 commit comments

Comments
 (0)