[−][src]Enum rustc_mir_build::thir::ExprKind

pub(crate) enum ExprKind<'tcx> {
    Scope {
        region_scope: Scope,
        lint_level: LintLevel,
        value: ExprRef<'tcx>,
    },
    Box {
        value: ExprRef<'tcx>,
    },
    Call {
        ty: Ty<'tcx>,
        fun: ExprRef<'tcx>,
        args: Vec<ExprRef<'tcx>>,
        from_hir_call: bool,
        fn_span: Span,
    },
    Deref {
        arg: ExprRef<'tcx>,
    },
    Binary {
        op: BinOp,
        lhs: ExprRef<'tcx>,
        rhs: ExprRef<'tcx>,
    },
    LogicalOp {
        op: LogicalOp,
        lhs: ExprRef<'tcx>,
        rhs: ExprRef<'tcx>,
    },
    Unary {
        op: UnOp,
        arg: ExprRef<'tcx>,
    },
    Cast {
        source: ExprRef<'tcx>,
    },
    Use {
        source: ExprRef<'tcx>,
    },
    NeverToAny {
        source: ExprRef<'tcx>,
    },
    Pointer {
        cast: PointerCast,
        source: ExprRef<'tcx>,
    },
    Loop {
        body: ExprRef<'tcx>,
    },
    Match {
        scrutinee: ExprRef<'tcx>,
        arms: Vec<Arm<'tcx>>,
    },
    Block {
        body: &'tcx Block<'tcx>,
    },
    Assign {
        lhs: ExprRef<'tcx>,
        rhs: ExprRef<'tcx>,
    },
    AssignOp {
        op: BinOp,
        lhs: ExprRef<'tcx>,
        rhs: ExprRef<'tcx>,
    },
    Field {
        lhs: ExprRef<'tcx>,
        name: Field,
    },
    Index {
        lhs: ExprRef<'tcx>,
        index: ExprRef<'tcx>,
    },
    VarRef {
        id: HirId,
    },
    UpvarRef {
        closure_def_id: DefId,
        var_hir_id: HirId,
    },
    Borrow {
        borrow_kind: BorrowKind,
        arg: ExprRef<'tcx>,
    },
    AddressOf {
        mutability: Mutability,
        arg: ExprRef<'tcx>,
    },
    Break {
        label: Scope,
        value: Option<ExprRef<'tcx>>,
    },
    Continue {
        label: Scope,
    },
    Return {
        value: Option<ExprRef<'tcx>>,
    },
    ConstBlock {
        value: &'tcx Const<'tcx>,
    },
    Repeat {
        value: ExprRef<'tcx>,
        count: &'tcx Const<'tcx>,
    },
    Array {
        fields: Vec<ExprRef<'tcx>>,
    },
    Tuple {
        fields: Vec<ExprRef<'tcx>>,
    },
    Adt {
        adt_def: &'tcx AdtDef,
        variant_index: VariantIdx,
        substs: SubstsRef<'tcx>,
        user_ty: Option<Canonical<'tcx, UserType<'tcx>>>,
        fields: Vec<FieldExprRef<'tcx>>,
        base: Option<FruInfo<'tcx>>,
    },
    PlaceTypeAscription {
        source: ExprRef<'tcx>,
        user_ty: Option<Canonical<'tcx, UserType<'tcx>>>,
    },
    ValueTypeAscription {
        source: ExprRef<'tcx>,
        user_ty: Option<Canonical<'tcx, UserType<'tcx>>>,
    },
    Closure {
        closure_id: DefId,
        substs: UpvarSubsts<'tcx>,
        upvars: Vec<ExprRef<'tcx>>,
        movability: Option<Movability>,
    },
    Literal {
        literal: &'tcx Const<'tcx>,
        user_ty: Option<Canonical<'tcx, UserType<'tcx>>>,
        const_id: Option<DefId>,
    },
    StaticRef {
        literal: &'tcx Const<'tcx>,
        def_id: DefId,
    },
    InlineAsm {
        template: &'tcx [InlineAsmTemplatePiece],
        operands: Vec<InlineAsmOperand<'tcx>>,
        options: InlineAsmOptions,
        line_spans: &'tcx [Span],
    },
    ThreadLocalRef(DefId),
    LlvmInlineAsm {
        asm: &'tcx LlvmInlineAsmInner,
        outputs: Vec<ExprRef<'tcx>>,
        inputs: Vec<ExprRef<'tcx>>,
    },
    Yield {
        value: ExprRef<'tcx>,
    },
}

Variants

Scope

Fields of Scope

region_scope: Scopelint_level: LintLevelvalue: ExprRef<'tcx>
Box

Fields of Box

value: ExprRef<'tcx>
Call

Fields of Call

ty: Ty<'tcx>fun: ExprRef<'tcx>args: Vec<ExprRef<'tcx>>from_hir_call: boolfn_span: Span

This Span is the span of the function, without the dot and receiver (e.g. foo(a, b) in x.foo(a, b)

Deref

Fields of Deref

arg: ExprRef<'tcx>
Binary

Fields of Binary

op: BinOplhs: ExprRef<'tcx>rhs: ExprRef<'tcx>
LogicalOp

Fields of LogicalOp

op: LogicalOplhs: ExprRef<'tcx>rhs: ExprRef<'tcx>
Unary

Fields of Unary

op: UnOparg: ExprRef<'tcx>
Cast

Fields of Cast

source: ExprRef<'tcx>
Use

Fields of Use

source: ExprRef<'tcx>
NeverToAny

Fields of NeverToAny

source: ExprRef<'tcx>
Pointer

Fields of Pointer

cast: PointerCastsource: ExprRef<'tcx>
Loop

Fields of Loop

body: ExprRef<'tcx>
Match

Fields of Match

scrutinee: ExprRef<'tcx>arms: Vec<Arm<'tcx>>
Block

Fields of Block

body: &'tcx Block<'tcx>
Assign

Fields of Assign

lhs: ExprRef<'tcx>rhs: ExprRef<'tcx>
AssignOp

Fields of AssignOp

op: BinOplhs: ExprRef<'tcx>rhs: ExprRef<'tcx>
Field

Fields of Field

lhs: ExprRef<'tcx>name: Field
Index

Fields of Index

lhs: ExprRef<'tcx>index: ExprRef<'tcx>
VarRef

Fields of VarRef

id: HirId
UpvarRef

Used to represent upvars mentioned in a closure/generator

Fields of UpvarRef

closure_def_id: DefId

DefId of the closure/generator

var_hir_id: HirId

HirId of the root variable

Borrow

Fields of Borrow

borrow_kind: BorrowKindarg: ExprRef<'tcx>
AddressOf

A &raw [const|mut] $place_expr raw borrow resulting in type *[const|mut] T.

Fields of AddressOf

mutability: Mutabilityarg: ExprRef<'tcx>
Break

Fields of Break

label: Scopevalue: Option<ExprRef<'tcx>>
Continue

Fields of Continue

label: Scope
Return

Fields of Return

value: Option<ExprRef<'tcx>>
ConstBlock

Fields of ConstBlock

value: &'tcx Const<'tcx>
Repeat

Fields of Repeat

value: ExprRef<'tcx>count: &'tcx Const<'tcx>
Array

Fields of Array

fields: Vec<ExprRef<'tcx>>
Tuple

Fields of Tuple

fields: Vec<ExprRef<'tcx>>
Adt

Fields of Adt

adt_def: &'tcx AdtDefvariant_index: VariantIdxsubsts: SubstsRef<'tcx>user_ty: Option<Canonical<'tcx, UserType<'tcx>>>

Optional user-given substs: for something like let x = Bar::<T> { ... }.

fields: Vec<FieldExprRef<'tcx>>base: Option<FruInfo<'tcx>>
PlaceTypeAscription

Fields of PlaceTypeAscription

source: ExprRef<'tcx>user_ty: Option<Canonical<'tcx, UserType<'tcx>>>

Type that the user gave to this expression

ValueTypeAscription

Fields of ValueTypeAscription

source: ExprRef<'tcx>user_ty: Option<Canonical<'tcx, UserType<'tcx>>>

Type that the user gave to this expression

Closure

Fields of Closure

closure_id: DefIdsubsts: UpvarSubsts<'tcx>upvars: Vec<ExprRef<'tcx>>movability: Option<Movability>
Literal

Fields of Literal

literal: &'tcx Const<'tcx>user_ty: Option<Canonical<'tcx, UserType<'tcx>>>const_id: Option<DefId>

The DefId of the const item this literal was produced from, if this is not a user-written literal value.

StaticRef

A literal containing the address of a static.

This is only distinguished from Literal so that we can register some info for diagnostics.

Fields of StaticRef

literal: &'tcx Const<'tcx>def_id: DefId
InlineAsm

Fields of InlineAsm

template: &'tcx [InlineAsmTemplatePiece]operands: Vec<InlineAsmOperand<'tcx>>options: InlineAsmOptionsline_spans: &'tcx [Span]
ThreadLocalRef(DefId)

An expression taking a reference to a thread local.

LlvmInlineAsm

Fields of LlvmInlineAsm

asm: &'tcx LlvmInlineAsmInneroutputs: Vec<ExprRef<'tcx>>inputs: Vec<ExprRef<'tcx>>
Yield

Fields of Yield

value: ExprRef<'tcx>

Trait Implementations

impl<'tcx> Clone for ExprKind<'tcx>[src]

impl<'tcx> Debug for ExprKind<'tcx>[src]

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for ExprKind<'tcx>

impl<'tcx> !Send for ExprKind<'tcx>

impl<'tcx> !Sync for ExprKind<'tcx>

impl<'tcx> Unpin for ExprKind<'tcx>

impl<'tcx> !UnwindSafe for ExprKind<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.