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.
This commit is contained in:
Nicholas Nethercote
2025-03-12 16:14:32 +11:00
parent aa8f0fd716
commit 9dd5340d3c
3 changed files with 8 additions and 23 deletions

View File

@@ -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 {