about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/token.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-03-12 16:14:32 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-03-24 18:43:37 +1100
commit9dd5340d3cbbd3acbe6cc9dfcbcea07e7eb4355e (patch)
tree5794f00500d66ab6312a9e1a28ba54e8649b0c0d /compiler/rustc_ast/src/token.rs
parentaa8f0fd7163a2f23aa958faed30c9c2b77b934a5 (diff)
downloadrust-9dd5340d3cbbd3acbe6cc9dfcbcea07e7eb4355e.tar.gz
rust-9dd5340d3cbbd3acbe6cc9dfcbcea07e7eb4355e.zip
Remove `is_any_keyword` methods.
They're dodgy, covering all the keywords, including weak ones, and
edition-specific ones without considering the edition. They have a
single use in rustfmt. This commit changes that use to
`is_reserved_ident`, which is a much more widely used alternative and is
good enough, judging by the lack of effect on the test suite.
Diffstat (limited to 'compiler/rustc_ast/src/token.rs')
-rw-r--r--compiler/rustc_ast/src/token.rs5
1 files changed, 0 insertions, 5 deletions
diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs
index f7cd63aaaf8..6e6f0f1b266 100644
--- a/compiler/rustc_ast/src/token.rs
+++ b/compiler/rustc_ast/src/token.rs
@@ -928,11 +928,6 @@ impl Token {
         self.is_non_raw_ident_where(Ident::is_path_segment_keyword)
     }
 
-    /// Don't use this unless you're doing something very loose and heuristic-y.
-    pub fn is_any_keyword(&self) -> bool {
-        self.is_non_raw_ident_where(Ident::is_any_keyword)
-    }
-
     /// Returns true for reserved identifiers used internally for elided lifetimes,
     /// unnamed method parameters, crate root module, error recovery etc.
     pub fn is_special_ident(&self) -> bool {