@@ -32,7 +32,7 @@ symbols! {
32
32
Keywords {
33
33
// Special reserved identifiers used internally for elided lifetimes,
34
34
// unnamed method parameters, crate root module, error recovery etc.
35
- // Matching predicates: `is_any_keyword`, ` is_special`/`is_reserved`
35
+ // Matching predicates: `is_special`/`is_reserved`
36
36
//
37
37
// Notes about `kw::Empty`:
38
38
// - Its use can blur the lines between "empty symbol" and "no symbol".
@@ -48,7 +48,7 @@ symbols! {
48
48
Underscore : "_" ,
49
49
50
50
// Keywords that are used in stable Rust.
51
- // Matching predicates: `is_any_keyword`, ` is_used_keyword_always`/`is_reserved`
51
+ // Matching predicates: `is_used_keyword_always`/`is_reserved`
52
52
As : "as" ,
53
53
Break : "break" ,
54
54
Const : "const" ,
@@ -86,7 +86,7 @@ symbols! {
86
86
While : "while" ,
87
87
88
88
// Keywords that are used in unstable Rust or reserved for future use.
89
- // Matching predicates: `is_any_keyword`, ` is_unused_keyword_always`/`is_reserved`
89
+ // Matching predicates: `is_unused_keyword_always`/`is_reserved`
90
90
Abstract : "abstract" ,
91
91
Become : "become" ,
92
92
Box : "box" ,
@@ -101,27 +101,27 @@ symbols! {
101
101
Yield : "yield" ,
102
102
103
103
// Edition-specific keywords that are used in stable Rust.
104
- // Matching predicates: `is_any_keyword`, ` is_used_keyword_conditional`/`is_reserved` (if
104
+ // Matching predicates: `is_used_keyword_conditional`/`is_reserved` (if
105
105
// the edition suffices)
106
106
Async : "async" , // >= 2018 Edition only
107
107
Await : "await" , // >= 2018 Edition only
108
108
Dyn : "dyn" , // >= 2018 Edition only
109
109
110
110
// Edition-specific keywords that are used in unstable Rust or reserved for future use.
111
- // Matching predicates: `is_any_keyword`, ` is_unused_keyword_conditional`/`is_reserved` (if
111
+ // Matching predicates: `is_unused_keyword_conditional`/`is_reserved` (if
112
112
// the edition suffices)
113
113
Gen : "gen" , // >= 2024 Edition only
114
114
Try : "try" , // >= 2018 Edition only
115
115
116
116
// NOTE: When adding new keywords, consider adding them to the ui/parser/raw/raw-idents.rs test.
117
117
118
118
// "Lifetime keywords": regular keywords with a leading `'`.
119
- // Matching predicates: `is_any_keyword`
119
+ // Matching predicates: none
120
120
UnderscoreLifetime : "'_" ,
121
121
StaticLifetime : "'static" ,
122
122
123
123
// Weak keywords, have special meaning only in specific contexts.
124
- // Matching predicates: `is_any_keyword`
124
+ // Matching predicates: none
125
125
Auto : "auto" ,
126
126
Builtin : "builtin" ,
127
127
Catch : "catch" ,
@@ -2675,11 +2675,6 @@ pub mod sym {
2675
2675
}
2676
2676
2677
2677
impl Symbol {
2678
- /// Don't use this unless you're doing something very loose and heuristic-y.
2679
- pub fn is_any_keyword ( self ) -> bool {
2680
- self >= kw:: As && self <= kw:: Yeet
2681
- }
2682
-
2683
2678
fn is_special ( self ) -> bool {
2684
2679
self <= kw:: Underscore
2685
2680
}
@@ -2736,11 +2731,6 @@ impl Symbol {
2736
2731
}
2737
2732
2738
2733
impl Ident {
2739
- /// Don't use this unless you're doing something very loose and heuristic-y.
2740
- pub fn is_any_keyword ( self ) -> bool {
2741
- self . name . is_any_keyword ( )
2742
- }
2743
-
2744
2734
/// Returns `true` for reserved identifiers used internally for elided lifetimes,
2745
2735
/// unnamed method parameters, crate root module, error recovery etc.
2746
2736
pub fn is_special ( self ) -> bool {
0 commit comments