Enum HirExpr
pub enum HirExpr {
Show 17 variants
Ident {
name: String,
span: SourceSpan,
},
Number(NumberLiteral),
String(String),
Bool(bool),
Array(Vec<ExprId>),
Tuple(Vec<ExprId>),
StructLit {
name: String,
fields: Vec<(String, ExprId)>,
},
Call {
callee: ExprId,
args: Vec<ExprId>,
},
IntrinsicCall {
intrinsic: IntrinsicId,
type_args: Vec<TypeExpr>,
args: Vec<ExprId>,
},
Field {
base: ExprId,
field: String,
},
Index {
base: ExprId,
index: ExprId,
},
SliceRange {
base: ExprId,
start: Option<ExprId>,
end: Option<ExprId>,
},
Prefix {
op: PrefixOp,
value: ExprId,
},
Binary {
op: BinaryOp,
lhs: ExprId,
rhs: ExprId,
},
Relational {
op: RelationalOp,
lhs: ExprId,
rhs: ExprId,
},
Block {
body: Vec<StmtId>,
},
SpliceMeta {
value: String,
},
}Expand description
HIR expression node.
Variants§
Ident
Identifier reference expression.
Fields
§
span: SourceSpanSource span covering the identifier token.
Number(NumberLiteral)
Numeric literal expression.
String(String)
String literal expression.
Bool(bool)
Boolean literal expression.
Array(Vec<ExprId>)
Array literal expression.
Tuple(Vec<ExprId>)
Tuple literal expression.
StructLit
Struct literal expression.
Fields
Call
Function call expression.
Fields
IntrinsicCall
Builtin intrinsic call expression.
Fields
§
intrinsic: IntrinsicIdBuiltin intrinsic identifier.
Field
Field projection expression.
Index
Collection indexing expression.
Fields
SliceRange
Slice-range expression over an array or slice.
Fields
Prefix
Prefix operator expression.
Binary
Binary operator expression.
Fields
Relational
Relational comparison expression.
Fields
§
op: RelationalOpRelational operator to apply.
Block
Nested block expression.
SpliceMeta
Meta splice placeholder retained in HIR.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HirExpr
impl RefUnwindSafe for HirExpr
impl Send for HirExpr
impl Sync for HirExpr
impl Unpin 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