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

🔬 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

🔬 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

🔬 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

🔬 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]

🔬 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]

🔬 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?

🔬 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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'tcx> Debug for Expr<'tcx>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Mirror<'tcx> for Expr<'tcx>
[src]

🔬 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?

🔬 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?

Auto Trait Implementations

impl<'tcx> !Send for Expr<'tcx>

impl<'tcx> !Sync for Expr<'tcx>