Struct rustc_ap_rustc_span::symbol::Symbol  [−][src]
pub struct Symbol(_);
Expand description
An interned string.
Internally, a Symbol is implemented as an index, and all operations
(including hashing, equality, and ordering) operate on that index. The use
of rustc_index::newtype_index! means that Option<Symbol> only takes up 4 bytes,
because rustc_index::newtype_index! reserves the last 256 values for tagging purposes.
Note that Symbol cannot directly be a rustc_index::newtype_index! because it
implements fmt::Debug, Encodable, and Decodable in special ways.
Implementations
Convert to a SymbolStr. This is a slowish operation because it
requires locking the symbol interner.
This method is supposed to be used in error messages, so it’s expected to be
identical to printing the original identifier token written in source code
(token_to_string, Ident::to_string), except that symbols don’t keep the rawness flag
or edition, so we have to guess the rawness using the global edition.
A keyword or reserved identifier that can be used as a path segment.
Returns true if the symbol is true or false.
Returns true if this symbol can be a raw identifier.
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Symbolimpl UnwindSafe for SymbolBlanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V