Skip to content

Commit e4cc8b1

Browse files
committed
XXX: is_special/is_special_ident -> is_reserved_ident
1 parent 7698e36 commit e4cc8b1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

compiler/rustc_ast/src/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,8 @@ impl Token {
918918
}
919919

920920
/// Returns true for reserved identifiers.
921-
pub fn is_special_ident(&self) -> bool {
922-
self.is_non_raw_ident_where(Ident::is_special)
921+
pub fn is_reserved_ident(&self) -> bool {
922+
self.is_non_raw_ident_where(Ident::is_reserved_ident)
923923
}
924924

925925
/// Returns `true` if the token is a keyword used in the language.

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ pub(super) enum TokenDescription {
423423
impl TokenDescription {
424424
pub(super) fn from_token(token: &Token) -> Option<Self> {
425425
match token.kind {
426-
_ if token.is_special_ident() => Some(TokenDescription::ReservedIdentifier),
426+
_ if token.is_reserved_ident() => Some(TokenDescription::ReservedIdentifier),
427427
_ if token.is_used_keyword() => Some(TokenDescription::Keyword),
428428
_ if token.is_unused_keyword() => Some(TokenDescription::ReservedKeyword),
429429
token::DocComment(..) => Some(TokenDescription::DocComment),

compiler/rustc_span/src/symbol.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mod tests;
2020

2121
// The proc macro code for this is in `compiler/rustc_macros/src/symbols.rs`.
2222
symbols! {
23-
// If you modify this list, adjust `is_special`, `is_used_keyword`/`is_unused_keyword`
23+
// If you modify this list, adjust `is_reserved_ident`, `is_used_keyword`/`is_unused_keyword`
2424
// and `AllKeywords`.
2525
// But this should rarely be necessary if the keywords are kept in alphabetic order.
2626
Keywords {
@@ -2584,7 +2584,7 @@ pub mod sym {
25842584
}
25852585

25862586
impl Symbol {
2587-
fn is_special(self) -> bool {
2587+
fn is_reserved_ident(self) -> bool {
25882588
self == sym::dollar_crate || self == sym::underscore
25892589
}
25902590

@@ -2606,7 +2606,7 @@ impl Symbol {
26062606
}
26072607

26082608
pub fn is_reserved(self, edition: impl Copy + FnOnce() -> Edition) -> bool {
2609-
self.is_special()
2609+
self.is_reserved_ident()
26102610
|| self.is_used_keyword_always()
26112611
|| self.is_unused_keyword_always()
26122612
|| self.is_used_keyword_conditional(edition)
@@ -2641,8 +2641,8 @@ impl Symbol {
26412641

26422642
impl Ident {
26432643
/// Returns `true` for reserved identifiers.
2644-
pub fn is_special(self) -> bool {
2645-
self.name.is_special()
2644+
pub fn is_reserved_ident(self) -> bool {
2645+
self.name.is_reserved_ident()
26462646
}
26472647

26482648
/// Returns `true` if the token is a keyword used in the language.

0 commit comments

Comments
 (0)