Struct rustc_mir::hair::Expr [−][src]
pub struct Expr<'tcx> { pub ty: Ty<'tcx>, pub temp_lifetime: Option<Scope>, pub span: Span, pub kind: ExprKind<'tcx>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The Hair 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
shortlived. They are created by Hair::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 Hair
. For
example, method calls and overloaded operators are absent: they are
expected to be converted into Expr::Call
instances.
Fields
ty: Ty<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
type of this expression
temp_lifetime: Option<Scope>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
lifetime of this expression if it should be spilled into a temporary; should be None only if in a constant context
span: Span
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
span of the expression in the source
kind: ExprKind<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
kind of expression
Trait Implementations
impl<'tcx> EvalInto<'tcx> for Expr<'tcx>
[src]
impl<'tcx> EvalInto<'tcx> for Expr<'tcx>
fn eval_into<'a, 'gcx>(
self,
builder: &mut Builder<'a, 'gcx, 'tcx>,
destination: &Place<'tcx>,
block: BasicBlock
) -> BlockAnd<()>
[src]
fn eval_into<'a, 'gcx>(
self,
builder: &mut Builder<'a, 'gcx, 'tcx>,
destination: &Place<'tcx>,
block: BasicBlock
) -> BlockAnd<()>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'a, 'tcx: 'a> ToRef for Expr<'tcx>
[src]
impl<'a, 'tcx: 'a> ToRef for Expr<'tcx>
type Output = ExprRef<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn to_ref(self) -> ExprRef<'tcx>
[src]
fn to_ref(self) -> ExprRef<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl<'tcx> Clone for Expr<'tcx>
[src]
impl<'tcx> Clone for Expr<'tcx>
fn clone(&self) -> Expr<'tcx>
[src]
fn clone(&self) -> Expr<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'tcx> Debug for Expr<'tcx>
[src]
impl<'tcx> Debug for Expr<'tcx>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'tcx> Mirror<'tcx> for Expr<'tcx>
[src]
impl<'tcx> Mirror<'tcx> for Expr<'tcx>
type Output = Expr<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn make_mirror<'a, 'gcx>(self, _: &mut Cx<'a, 'gcx, 'tcx>) -> Expr<'tcx>
[src]
fn make_mirror<'a, 'gcx>(self, _: &mut Cx<'a, 'gcx, 'tcx>) -> Expr<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?