pub struct Expr {
pub kind: ExprKind,
pub ty: TypeId,
pub category: Category,
}Expand description
An expression, its type, and what may be done with it.
Twenty four bytes: the kind, the type it has, and the category it is in. The type is in the node rather than in a table beside it, which is the opposite of what the untyped tree does with spans, because everything that walks this tree reads the type at every node and almost nothing reads the span at any node.
Fields§
§kind: ExprKindWhat the expression is.
ty: TypeIdThe type it has, after every conversion that applies to it.
category: CategoryWhat may be done with it.
Implementations§
Trait Implementations§
impl Copy for Expr
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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