Enum HirStmt
pub enum HirStmt {
Let {
name: String,
name_span: SourceSpan,
ownership: OwnershipMode,
mode: AssignMode,
value: ExprId,
},
Assign {
target: AssignTarget,
mode: AssignMode,
value: ExprId,
},
If {
condition: ExprId,
then_body: Vec<StmtId>,
else_body: Option<Vec<StmtId>>,
},
For {
binding_name: String,
binding_name_span: SourceSpan,
binding_is_mut_borrow: bool,
iterable: ExprId,
body: Vec<StmtId>,
},
While {
condition: ExprId,
body: Vec<StmtId>,
},
Match {
value: ExprId,
arms: Vec<HirMatchArm>,
},
Meta {
body_len: usize,
},
Expr {
expr: ExprId,
has_semi: bool,
},
}Expand description
HIR statement node.
Variants§
Let
Binding declaration statement.
Fields
§
name_span: SourceSpanSource span covering the binding name token.
§
ownership: OwnershipModeOwnership mode assigned to the local binding.
§
mode: AssignModeAssignment mode used to initialize the binding.
Assign
Assignment to an existing binding or field path.
Fields
§
target: AssignTargetTarget path being assigned into.
§
mode: AssignModeAssignment mode used to initialize the binding.
If
Conditional statement.
Fields
For
Collection iteration statement.
Fields
§
binding_name_span: SourceSpanSource span covering the iteration binding name token.
While
Loop that repeats while a condition remains true.
Fields
Match
Enum match statement.
Fields
§
arms: Vec<HirMatchArm>Arms evaluated in order.
Meta
Meta block placeholder retained in HIR.
Expr
Standalone expression statement.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HirStmt
impl RefUnwindSafe for HirStmt
impl Send for HirStmt
impl Sync for HirStmt
impl Unpin for HirStmt
impl UnwindSafe for HirStmt
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