Expand description
An “interner” is a data structure that associates values with usize tags and allows bidirectional lookup; i.e., given a value, one can easily find the type, and vice versa.
Re-exports§
use std::hash::BuildHasher;🔒use std::hash::Hash;🔒use std::hash::Hash;🔒use std::hash::Hasher;🔒use std::fmt;🔒use std::str;🔒use rustc_arena::DroplessArena;🔒use rustc_data_structures::fx::FxBuildHasher;🔒use rustc_data_structures::hash_table::Entry;🔒use rustc_data_structures::hash_table::HashTable;🔒use rustc_data_structures::stable_hash::StableCompare;🔒use rustc_data_structures::stable_hash::StableHash;🔒use rustc_data_structures::stable_hash::StableHashCtxt;🔒use rustc_data_structures::stable_hash::StableHasher;🔒use rustc_data_structures::sync::Lock;🔒use rustc_macros::Decodable;🔒use rustc_macros::Encodable;🔒use rustc_macros::StableHash;🔒use rustc_macros::symbols;🔒use rustc_serialize::ContextOrd;🔒use crate::edit_distance::find_best_match_for_name;🔒use crate::DUMMY_SP;🔒use crate::Edition;🔒use crate::Span;🔒use crate::with_session_globals;🔒
Modules§
- kw
- This module contains all the defined keyword
Symbols. - sym
- This module contains all the defined non-keyword
Symbols.
Structs§
- Byte
Symbol - Like
Symbol, but for byte strings.ByteSymbolis used less widely, so it has fewer operations defined thanSymbol. - Ident
- Ident
Printer - The most general type to print identifiers.
- Interner 🔒
- Interner
Inner 🔒 - Macro
Rules Normalized Ident - A newtype around
Identthat calls Ident::normalize_to_macro_rules on construction for “local variable hygiene” comparisons. - Symbol
- An interned UTF-8 string.
- Symbol
Index 🔒
Enums§
Constants§
- PREDEFINED_
SYMBOLS_ COUNT - The number of predefined symbols; this is the first index for
extra pre-interned symbols in an Interner created via
Interner::with_extra_symbols. - STDLIB_
STABLE_ CRATES - Symbols for crates that are part of the stable standard library:
std,core,alloc, andproc_macro. - SYMBOL_
DIGITS_ 🔒BASE - SYMBOL_
LOWERCASE_ 🔒LETTERS_ BASE - SYMBOL_
UPPERCASE_ 🔒LETTERS_ BASE
Functions§
- used_
keywords - Collect all the keywords in a given edition into a vector.