@@ -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" ,
@@ -2677,11 +2677,6 @@ pub mod sym {
2677
2677
}
2678
2678
2679
2679
impl Symbol {
2680
- /// Don't use this unless you're doing something very loose and heuristic-y.
2681
- pub fn is_any_keyword ( self ) -> bool {
2682
- self >= kw:: As && self <= kw:: Yeet
2683
- }
2684
-
2685
2680
fn is_special ( self ) -> bool {
2686
2681
self <= kw:: Underscore
2687
2682
}
@@ -2738,11 +2733,6 @@ impl Symbol {
2738
2733
}
2739
2734
2740
2735
impl Ident {
2741
- /// Don't use this unless you're doing something very loose and heuristic-y.
2742
- pub fn is_any_keyword ( self ) -> bool {
2743
- self . name . is_any_keyword ( )
2744
- }
2745
-
2746
2736
/// Returns `true` for reserved identifiers used internally for elided lifetimes,
2747
2737
/// unnamed method parameters, crate root module, error recovery etc.
2748
2738
pub fn is_special ( self ) -> bool {
0 commit comments