From 1d2e172935a90ecc146ac4b9e82ab1485f4d7fdd Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 3 May 2022 15:12:43 +1000 Subject: [PATCH] Remove unnecessary `NtIdent` in `Token::is_whole_expr`. The comment on this function explains that it's a specialized version of `maybe_whole_expr`. But `maybe_whole_expr` doesn't do anything with `NtIdent`, so `is_whole_expr` also doesn't need to. --- compiler/rustc_ast/src/token.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs index 4eb494aeb9b..1c366bc8e9a 100644 --- a/compiler/rustc_ast/src/token.rs +++ b/compiler/rustc_ast/src/token.rs @@ -531,7 +531,7 @@ impl Token { /// (which happens while parsing the result of macro expansion)? pub fn is_whole_expr(&self) -> bool { if let Interpolated(ref nt) = self.kind - && let NtExpr(_) | NtLiteral(_) | NtPath(_) | NtIdent(..) | NtBlock(_) = **nt + && let NtExpr(_) | NtLiteral(_) | NtPath(_) | NtBlock(_) = **nt { return true; }