1
Fork 0

symbols: add is_preinterned fn to check if symbol was preinterned in compiler

This commit is contained in:
klensy 2022-08-20 15:13:41 +03:00
parent 36e530cb08
commit 0016356f2b
2 changed files with 6 additions and 1 deletions

View file

@ -2027,6 +2027,11 @@ impl Symbol {
pub fn can_be_raw(self) -> bool {
self != kw::Empty && self != kw::Underscore && !self.is_path_segment_keyword()
}
/// Is this symbol was interned in compiler's `symbols!` macro
pub fn is_preinterned(self) -> bool {
self.as_u32() < PREINTERNED_SYMBOLS_COUNT
}
}
impl Ident {