Enum rustc_ast_lowering::ast::LitKind [−][src]
pub enum LitKind {
Str(Symbol, StrStyle),
ByteStr(Rc<[u8]>),
Byte(u8),
Char(char),
Int(u128, LitIntType),
Float(Symbol, LitFloatType),
Bool(bool),
Err(Symbol),
}Expand description
Literal kind.
E.g., "foo", 42, 12.34, or bool.
Variants
Str(Symbol, StrStyle)
A string literal ("foo").
ByteStr(Rc<[u8]>)
A byte string (b"foo").
Byte(u8)
Tuple Fields
0: u8A byte char (b'f').
Char(char)
Tuple Fields
0: charA character literal ('a').
Int(u128, LitIntType)
An integer literal (1).
Float(Symbol, LitFloatType)
A float literal (1f64 or 1E10f64).
Bool(bool)
Tuple Fields
0: boolA boolean literal.
Err(Symbol)
Tuple Fields
0: SymbolPlaceholder for a literal that wasn’t well-formed in some way.
Auto Trait Implementations
impl RefUnwindSafe for LitKind
impl UnwindSafe for LitKind
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: 24 bytes
Size for each variant:
Str: 11 bytesByteStr: 23 bytesByte: 1 byteChar: 7 bytesInt: 23 bytesFloat: 7 bytesBool: 1 byteErr: 7 bytes