pub enum HirExpr {
Variable(HirVariable),
Binary {
lhs: HirExprId,
op: BinaryOp,
rhs: HirExprId,
},
Assign {
lhs: HirExprId,
rhs: HirExprId,
mode: AssignMode,
},
Unary {
operand: HirExprId,
mode: UnaryMode,
op: String,
},
Call {
args: Vec<HirExprId>,
ast_kind: String,
},
Opaque {
ast_kind: String,
},
}Expand description
One expression node in the HIR body graph.
Every variant that has child expressions carries explicit HirExprId
references — there are no flat shells.
Variants§
Variable(HirVariable)
Variable read or write-place reference.
Binary
Binary expression: lhs OP rhs, both children are explicit IDs.
Assign
Assignment expression: lhs = rhs, both sides are explicit IDs.
For my $x = …, the lhs is a Variable node with access: Write
representing the declared place, and rhs is the initializer.
Fields
§
mode: AssignModeAssignment mode.
Unary
Unary expression: OP operand.
Fields
Call
Function/method call expression (first-pass model).
Arguments that are individually lowerable carry explicit IDs; everything
else is Opaque.
Fields
Opaque
Opaque expression — used when the AST shape is not yet modeled.
Trait Implementations§
impl Eq for HirExpr
impl StructuralPartialEq for HirExpr
Auto Trait Implementations§
impl Freeze for HirExpr
impl RefUnwindSafe for HirExpr
impl Send for HirExpr
impl Sync for HirExpr
impl Unpin for HirExpr
impl UnsafeUnpin for HirExpr
impl UnwindSafe for HirExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more