[−][src]Struct rustc_mir_build::thir::Expr
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 ExprRef<'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<'tcx>kind of expression
Trait Implementations
impl<'tcx> Clone for Expr<'tcx>[src]
impl<'tcx> Debug for Expr<'tcx>[src]
impl<'tcx> EvalInto<'tcx> for Expr<'tcx>[src]
pub(in build) fn eval_into(
self,
builder: &mut Builder<'_, 'tcx>,
destination: Place<'tcx>,
block: BasicBlock
) -> BlockAnd<()>[src]
self,
builder: &mut Builder<'_, 'tcx>,
destination: Place<'tcx>,
block: BasicBlock
) -> BlockAnd<()>
impl<'tcx> Mirror<'tcx> for Expr<'tcx>[src]
impl<'tcx> ToRef for Expr<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for Expr<'tcx>
impl<'tcx> !Send for Expr<'tcx>
impl<'tcx> !Sync for Expr<'tcx>
impl<'tcx> Unpin for Expr<'tcx>
impl<'tcx> !UnwindSafe for Expr<'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> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
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>,