Struct rustc_ast::ast::Lit [−][src]
Expand description
An AST literal.
Fields
token: Lit
The original literal token as written in source code.
kind: LitKind
The “semantic” representation of the literal lowered from the original tokens. Strings are unescaped, hexadecimal forms are eliminated, etc. FIXME: Remove this and only create the semantic representation during lowering to HIR.
span: Span
Implementations
Converts literal token into an AST literal.
Converts arbitrary token into an AST literal.
Keep this in sync with Token::can_begin_literal_or_bool
excluding unary negation.
Attempts to recover an AST literal from semantic literal. This function is used when the original token doesn’t exist (e.g. the literal is created by an AST-based macro) or unavailable (e.g. from HIR pretty-printing).
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Lit
impl UnwindSafe for Lit
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes