@@ -32,14 +32,14 @@ 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
Empty : "" ,
37
37
PathRoot : "{{root}}" ,
38
38
DollarCrate : "$crate" ,
39
39
Underscore : "_" ,
40
40
41
41
// Keywords that are used in stable Rust.
42
- // Matching predicates: `is_any_keyword`, ` is_used_keyword_always`/`is_reserved`
42
+ // Matching predicates: `is_used_keyword_always`/`is_reserved`
43
43
As : "as" ,
44
44
Break : "break" ,
45
45
Const : "const" ,
@@ -77,7 +77,7 @@ symbols! {
77
77
While : "while" ,
78
78
79
79
// Keywords that are used in unstable Rust or reserved for future use.
80
- // Matching predicates: `is_any_keyword`, ` is_unused_keyword_always`/`is_reserved`
80
+ // Matching predicates: `is_unused_keyword_always`/`is_reserved`
81
81
Abstract : "abstract" ,
82
82
Become : "become" ,
83
83
Box : "box" ,
@@ -92,27 +92,27 @@ symbols! {
92
92
Yield : "yield" ,
93
93
94
94
// Edition-specific keywords that are used in stable Rust.
95
- // Matching predicates: `is_any_keyword`, ` is_used_keyword_conditional`/`is_reserved` (if
95
+ // Matching predicates: `is_used_keyword_conditional`/`is_reserved` (if
96
96
// the edition suffices)
97
97
Async : "async" , // >= 2018 Edition only
98
98
Await : "await" , // >= 2018 Edition only
99
99
Dyn : "dyn" , // >= 2018 Edition only
100
100
101
101
// Edition-specific keywords that are used in unstable Rust or reserved for future use.
102
- // Matching predicates: `is_any_keyword`, ` is_unused_keyword_conditional`/`is_reserved` (if
102
+ // Matching predicates: `is_unused_keyword_conditional`/`is_reserved` (if
103
103
// the edition suffices)
104
104
Gen : "gen" , // >= 2024 Edition only
105
105
Try : "try" , // >= 2018 Edition only
106
106
107
107
// NOTE: When adding new keywords, consider adding them to the ui/parser/raw/raw-idents.rs test.
108
108
109
109
// "Lifetime keywords": regular keywords with a leading `'`.
110
- // Matching predicates: `is_any_keyword`
110
+ // Matching predicates: none
111
111
UnderscoreLifetime : "'_" ,
112
112
StaticLifetime : "'static" ,
113
113
114
114
// Weak keywords, have special meaning only in specific contexts.
115
- // Matching predicates: `is_any_keyword`
115
+ // Matching predicates: none
116
116
Auto : "auto" ,
117
117
Builtin : "builtin" ,
118
118
Catch : "catch" ,
@@ -2653,11 +2653,6 @@ pub mod sym {
2653
2653
}
2654
2654
2655
2655
impl Symbol {
2656
- /// Don't use this unless you're doing something very loose and heuristic-y.
2657
- pub fn is_any_keyword ( self ) -> bool {
2658
- self >= kw:: As && self <= kw:: Yeet
2659
- }
2660
-
2661
2656
fn is_special ( self ) -> bool {
2662
2657
self <= kw:: Underscore
2663
2658
}
@@ -2714,11 +2709,6 @@ impl Symbol {
2714
2709
}
2715
2710
2716
2711
impl Ident {
2717
- /// Don't use this unless you're doing something very loose and heuristic-y.
2718
- pub fn is_any_keyword ( self ) -> bool {
2719
- self . name . is_any_keyword ( )
2720
- }
2721
-
2722
2712
/// Returns `true` for reserved identifiers used internally for elided lifetimes,
2723
2713
/// unnamed method parameters, crate root module, error recovery etc.
2724
2714
pub fn is_special ( self ) -> bool {
0 commit comments