Struct rustc_mir_build::thir::Expr [−][src]
The Thir trait implementor lowers their expressions (&'tcx H::Expr)
into instances of this Expr enum. This lowering can be done
basically as lazily or as eagerly as desired: every recursive
reference to an expression in this enum is an &'thir Expr<'thir, 'tcx>, which
may in turn be another instance of this enum (boxed), or else an
unlowered &'tcx H::Expr. Note that instances of Expr are very
short-lived. They are created by Thir::to_expr, analyzed and
converted into MIR, and then discarded.
If you compare Expr to the full compiler AST, you will see it is
a good bit simpler. In fact, a number of the more straight-forward
MIR simplifications are already done in the impl of Thir. For
example, method calls and overloaded operators are absent: they are
expected to be converted into Expr::Call instances.
Fields
ty: Ty<'tcx>type of this expression
temp_lifetime: Option<Scope>lifetime of this expression if it should be spilled into a temporary; should be None only if in a constant context
span: Spanspan of the expression in the source
kind: ExprKind<'thir, 'tcx>kind of expression
Trait Implementations
impl<'thir, 'tcx> ArenaAllocatable<'thir, 'tcx, Expr<'thir, 'tcx>> for Expr<'thir, 'tcx>[src]
fn allocate_on(self, arena: &'thir Arena<'thir, 'tcx>) -> &'thir mut Self[src]
fn allocate_from_iter(
arena: &'thir Arena<'thir, 'tcx>,
iter: impl IntoIterator<Item = Self>
) -> &'thir mut [Self][src]
arena: &'thir Arena<'thir, 'tcx>,
iter: impl IntoIterator<Item = Self>
) -> &'thir mut [Self]
impl<'thir, 'tcx> Debug for Expr<'thir, 'tcx>[src]
Auto Trait Implementations
impl<'thir, 'tcx> !RefUnwindSafe for Expr<'thir, 'tcx>
impl<'thir, 'tcx> !Send for Expr<'thir, 'tcx>
impl<'thir, 'tcx> !Sync for Expr<'thir, 'tcx>
impl<'thir, 'tcx> Unpin for Expr<'thir, 'tcx> where
'tcx: 'thir,
'tcx: 'thir,
impl<'thir, 'tcx> !UnwindSafe for Expr<'thir, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,