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

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

Variants

Scope
Show fields

Fields of Scope

region_scope: Scopelint_level: LintLevelvalue: &'thir Expr<'thir, 'tcx>
Box
Show fields

Fields of Box

value: &'thir Expr<'thir, 'tcx>
If
Show fields

Fields of If

cond: &'thir Expr<'thir, 'tcx>then: &'thir Expr<'thir, 'tcx>else_opt: Option<&'thir Expr<'thir, 'tcx>>
Call
Show fields

Fields of Call

ty: Ty<'tcx>fun: &'thir Expr<'thir, 'tcx>args: &'thir [Expr<'thir, 'tcx>]from_hir_call: bool
Expand description

Whether this is from a call in HIR, rather than from an overloaded operator. true for overloaded function call.

fn_span: Span
Expand description

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

Deref
Show fields

Fields of Deref

arg: &'thir Expr<'thir, 'tcx>
Binary
Show fields

Fields of Binary

op: BinOplhs: &'thir Expr<'thir, 'tcx>rhs: &'thir Expr<'thir, 'tcx>
LogicalOp
Show fields

Fields of LogicalOp

op: LogicalOplhs: &'thir Expr<'thir, 'tcx>rhs: &'thir Expr<'thir, 'tcx>
Unary
Show fields

Fields of Unary

op: UnOparg: &'thir Expr<'thir, 'tcx>
Cast
Show fields

Fields of Cast

source: &'thir Expr<'thir, 'tcx>
Use
Show fields

Fields of Use

source: &'thir Expr<'thir, 'tcx>
NeverToAny
Show fields

Fields of NeverToAny

source: &'thir Expr<'thir, 'tcx>
Pointer
Show fields

Fields of Pointer

cast: PointerCastsource: &'thir Expr<'thir, 'tcx>
Loop
Show fields

Fields of Loop

body: &'thir Expr<'thir, 'tcx>
Match
Show fields

Fields of Match

scrutinee: &'thir Expr<'thir, 'tcx>arms: &'thir [Arm<'thir, 'tcx>]
Block
Show fields

Fields of Block

body: Block<'thir, 'tcx>
Assign
Show fields

Fields of Assign

lhs: &'thir Expr<'thir, 'tcx>rhs: &'thir Expr<'thir, 'tcx>
AssignOp
Show fields

Fields of AssignOp

op: BinOplhs: &'thir Expr<'thir, 'tcx>rhs: &'thir Expr<'thir, 'tcx>
Field
Show fields

Fields of Field

lhs: &'thir Expr<'thir, 'tcx>name: Field
Index
Show fields

Fields of Index

lhs: &'thir Expr<'thir, 'tcx>index: &'thir Expr<'thir, 'tcx>
VarRef
Show fields

Fields of VarRef

id: HirId
UpvarRef
Expand description

Used to represent upvars mentioned in a closure/generator

Show fields

Fields of UpvarRef

closure_def_id: DefId
Expand description

DefId of the closure/generator

var_hir_id: HirId
Expand description

HirId of the root variable

Borrow
Show fields

Fields of Borrow

borrow_kind: BorrowKindarg: &'thir Expr<'thir, 'tcx>
AddressOf
Expand description

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

Show fields

Fields of AddressOf

mutability: Mutabilityarg: &'thir Expr<'thir, 'tcx>
Break
Show fields

Fields of Break

label: Scopevalue: Option<&'thir Expr<'thir, 'tcx>>
Continue
Show fields

Fields of Continue

label: Scope
Return
Show fields

Fields of Return

value: Option<&'thir Expr<'thir, 'tcx>>
ConstBlock
Show fields

Fields of ConstBlock

value: &'tcx Const<'tcx>
Repeat
Show fields

Fields of Repeat

value: &'thir Expr<'thir, 'tcx>count: &'tcx Const<'tcx>
Array
Show fields

Fields of Array

fields: &'thir [Expr<'thir, 'tcx>]
Tuple
Show fields

Fields of Tuple

fields: &'thir [Expr<'thir, 'tcx>]
Adt
Show fields

Fields of Adt

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

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

fields: &'thir [FieldExpr<'thir, 'tcx>]base: Option<FruInfo<'thir, 'tcx>>
PlaceTypeAscription
Show fields

Fields of PlaceTypeAscription

source: &'thir Expr<'thir, 'tcx>user_ty: Option<Canonical<'tcx, UserType<'tcx>>>
Expand description

Type that the user gave to this expression

ValueTypeAscription
Show fields

Fields of ValueTypeAscription

source: &'thir Expr<'thir, 'tcx>user_ty: Option<Canonical<'tcx, UserType<'tcx>>>
Expand description

Type that the user gave to this expression

Closure
Show fields

Fields of Closure

closure_id: DefIdsubsts: UpvarSubsts<'tcx>upvars: &'thir [Expr<'thir, 'tcx>]movability: Option<Movability>fake_reads: Vec<(&'thir Expr<'thir, 'tcx>, FakeReadCause, HirId)>
Literal
Show fields

Fields of Literal

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

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

StaticRef
Expand description

A literal containing the address of a static.

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

Show fields

Fields of StaticRef

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

Fields of InlineAsm

template: &'tcx [InlineAsmTemplatePiece]operands: &'thir [InlineAsmOperand<'thir, 'tcx>]options: InlineAsmOptionsline_spans: &'tcx [Span]
ThreadLocalRef(DefId)
Expand description

An expression taking a reference to a thread local.

LlvmInlineAsm
Show fields

Fields of LlvmInlineAsm

asm: &'tcx LlvmInlineAsmInneroutputs: &'thir [Expr<'thir, 'tcx>]inputs: &'thir [Expr<'thir, 'tcx>]
Yield
Show fields

Fields of Yield

value: &'thir Expr<'thir, 'tcx>

Trait Implementations

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

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

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

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

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

impl<'thir, 'tcx> Unpin for ExprKind<'thir, 'tcx> where
    'tcx: 'thir, 

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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