Enum rustc_resolve::LitKind[−][src]

pub(crate) 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)

Tuple Fields

0: Symbol

A string literal ("foo").

ByteStr(Rc<[u8]>)

Tuple Fields

0: Rc<[u8]>

A byte string (b"foo").

Byte(u8)

Tuple Fields

0: u8

A byte char (b'f').

Char(char)

Tuple Fields

0: char

A character literal ('a').

Int(u128, LitIntType)

Tuple Fields

0: u128

An integer literal (1).

Float(Symbol, LitFloatType)

Tuple Fields

0: Symbol

A float literal (1f64 or 1E10f64).

Bool(bool)

Tuple Fields

0: bool

A boolean literal.

Err(Symbol)

Tuple Fields

0: Symbol

Placeholder for a literal that wasn’t well-formed in some way.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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: