about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-05-03 15:12:43 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-05-04 06:15:36 +1000
commit1d2e172935a90ecc146ac4b9e82ab1485f4d7fdd (patch)
tree983a7a50a6e7afc607e55a35a56d1b0f8ab7fda4
parentbbef9756ea5a0b30f737aa038ea8622159cff08a (diff)
downloadrust-1d2e172935a90ecc146ac4b9e82ab1485f4d7fdd.tar.gz
rust-1d2e172935a90ecc146ac4b9e82ab1485f4d7fdd.zip
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.
-rw-r--r--compiler/rustc_ast/src/token.rs2
1 files changed, 1 insertions, 1 deletions
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;
         }