diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-03-31 23:05:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-31 23:05:45 +0200 |
| commit | 2f5d5480027f9a12a833fadfa8398ebef7c8d944 (patch) | |
| tree | 8c95add61f5042b9c790d98c1ca1700b1d080b9d /compiler/rustc_span/src/symbol.rs | |
| parent | 50485342a08adf644e30def3a0245649d9dbafbb (diff) | |
| parent | 27850631638e74bd017d963a35c53e7f81f42e4d (diff) | |
Rollup merge of #139039 - nnethercote:less-kw-Empty-4, r=petrochenkov
Reduce kw::Empty usage, part 4 Another step towards #137978. r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_span/src/symbol.rs')
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 47dd80c432e..c6e570e524f 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -131,7 +131,7 @@ symbols! { // tidy-alphabetical-end // Weak keywords, have special meaning only in specific contexts. - // Matching predicates: none + // Matching predicates: `is_weak` // tidy-alphabetical-start Auto: "auto", Builtin: "builtin", @@ -2725,6 +2725,10 @@ impl Symbol { || self.is_unused_keyword_conditional(edition) } + pub fn is_weak(self) -> bool { + self >= kw::Auto && self <= kw::Yeet + } + /// A keyword or reserved identifier that can be used as a path segment. pub fn is_path_segment_keyword(self) -> bool { self == kw::Super |
