pub enum Expr {
Show 29 variants Void, Error, IntLit { lit: u64, }, DecLit { lit: f64, }, StrLit { lit: CString, }, CharLit { lit: i8, }, BoolLit { lit: bool, }, Const(Const), DeclRef { id: DeclRefId, }, Call { callee: ExprId, arguments: SmallVec<[ExprId; 2]>, }, AddrOf { expr: ExprId, is_mut: bool, }, Pointer { expr: ExprId, is_mut: bool, }, FunctionTy { param_tys: Vec<ExprId>, ret_ty: ExprId, }, Deref(ExprId), Set { lhs: ExprId, rhs: ExprId, }, Do { scope: ImperScopeId, }, If { condition: ExprId, then_scope: ImperScopeId, else_scope: Option<ImperScopeId>, }, While { loop_id: LoopId, condition: ExprId, scope: ImperScopeId, }, For { loop_id: LoopId, binding: DeclId, lower_bound: ExprId, upper_bound: ExprId, scope: ImperScopeId, }, Break(Option<LoopId>), Continue(Option<LoopId>), Switch { scrutinee: ExprId, cases: Vec<SwitchCase>, }, Cast { expr: ExprId, ty: ExprId, cast_id: CastId, }, Ret { expr: ExprId, decl: Option<DeclId>, }, Mod { id: ModScopeId, extern_library_path: Option<ExprId>, }, Import { path: ExprId, }, Struct(StructId), Enum(EnumId), StructLit { ty: ExprId, fields: Vec<FieldAssignment>, id: StructLitId, },
}

Variants

Void

Error

IntLit

Fields

lit: u64

DecLit

Fields

lit: f64

StrLit

Fields

lit: CString

CharLit

Fields

lit: i8

BoolLit

Fields

lit: bool

Const(Const)

DeclRef

Fields

Call

Fields

callee: ExprId
arguments: SmallVec<[ExprId; 2]>

AddrOf

Fields

expr: ExprId
is_mut: bool

Pointer

Fields

expr: ExprId
is_mut: bool

Transforms type into pointer type

FunctionTy

Fields

param_tys: Vec<ExprId>
ret_ty: ExprId

Deref(ExprId)

Set

Fields

lhs: ExprId
rhs: ExprId

Do

Fields

scope: ImperScopeId

If

Fields

condition: ExprId
then_scope: ImperScopeId
else_scope: Option<ImperScopeId>

While

Fields

loop_id: LoopId
condition: ExprId
scope: ImperScopeId

For

Fields

loop_id: LoopId
binding: DeclId
lower_bound: ExprId
upper_bound: ExprId
scope: ImperScopeId

Break(Option<LoopId>)

Continue(Option<LoopId>)

Switch

Fields

scrutinee: ExprId
cases: Vec<SwitchCase>

Cast

Fields

expr: ExprId
ty: ExprId
cast_id: CastId

Ret

Fields

expr: ExprId
decl: Option<DeclId>

Mod

Fields

extern_library_path: Option<ExprId>

Import

Fields

path: ExprId

Struct(StructId)

Enum(EnumId)

StructLit

Fields

ty: ExprId

Trait Implementations

Formats the value using the given formatter. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.