Enum rustc::hir::Expr_ [] [src]

pub enum Expr_ {
    ExprBox(P<Expr>),
    ExprArray(HirVec<Expr>),
    ExprCall(P<Expr>, HirVec<Expr>),
    ExprMethodCall(Spanned<Name>, HirVec<P<Ty>>, HirVec<Expr>),
    ExprTup(HirVec<Expr>),
    ExprBinary(BinOpP<Expr>, P<Expr>),
    ExprUnary(UnOpP<Expr>),
    ExprLit(P<Lit>),
    ExprCast(P<Expr>, P<Ty>),
    ExprType(P<Expr>, P<Ty>),
    ExprIf(P<Expr>, P<Block>, Option<P<Expr>>),
    ExprWhile(P<Expr>, P<Block>, Option<Spanned<Name>>),
    ExprLoop(P<Block>, Option<Spanned<Name>>, LoopSource),
    ExprMatch(P<Expr>, HirVec<Arm>, MatchSource),
    ExprClosure(CaptureClauseP<FnDecl>, BodyIdSpan),
    ExprBlock(P<Block>),
    ExprAssign(P<Expr>, P<Expr>),
    ExprAssignOp(BinOpP<Expr>, P<Expr>),
    ExprField(P<Expr>, Spanned<Name>),
    ExprTupField(P<Expr>, Spanned<usize>),
    ExprIndex(P<Expr>, P<Expr>),
    ExprPath(QPath),
    ExprAddrOf(MutabilityP<Expr>),
    ExprBreak(DestinationOption<P<Expr>>),
    ExprAgain(Destination),
    ExprRet(Option<P<Expr>>),
    ExprInlineAsm(P<InlineAsm>, HirVec<Expr>, HirVec<Expr>),
    ExprStruct(QPathHirVec<Field>, Option<P<Expr>>),
    ExprRepeat(P<Expr>, BodyId),
}
🔬 This is a nightly-only experimental API. (rustc_private)

Variants

🔬 This is a nightly-only experimental API. (rustc_private)

A box x expression.

🔬 This is a nightly-only experimental API. (rustc_private)

An array ([a, b, c, d])

🔬 This is a nightly-only experimental API. (rustc_private)

A function call

The first field resolves to the function itself (usually an ExprPath), and the second field is the list of arguments

🔬 This is a nightly-only experimental API. (rustc_private)

A method call (x.foo::<Bar, Baz>(a, b, c, d))

The Spanned<Name> is the identifier for the method name. The vector of Tys are the ascripted type parameters for the method (within the angle brackets).

The first element of the vector of Exprs is the expression that evaluates to the object on which the method is being called on (the receiver), and the remaining elements are the rest of the arguments.

Thus, x.foo::<Bar, Baz>(a, b, c, d) is represented as ExprMethodCall(foo, [Bar, Baz], [x, a, b, c, d]).

🔬 This is a nightly-only experimental API. (rustc_private)

A tuple ((a, b, c ,d))

🔬 This is a nightly-only experimental API. (rustc_private)

A binary operation (For example: a + b, a * b)

🔬 This is a nightly-only experimental API. (rustc_private)

A unary operation (For example: !x, *x)

🔬 This is a nightly-only experimental API. (rustc_private)

A literal (For example: 1, "foo")

🔬 This is a nightly-only experimental API. (rustc_private)

A cast (foo as f64)

🔬 This is a nightly-only experimental API. (rustc_private)
🔬 This is a nightly-only experimental API. (rustc_private)

An if block, with an optional else block

if expr { block } else { expr }

🔬 This is a nightly-only experimental API. (rustc_private)

A while loop, with an optional label

'label: while expr { block }

🔬 This is a nightly-only experimental API. (rustc_private)

Conditionless loop (can be exited with break, continue, or return)

'label: loop { block }

🔬 This is a nightly-only experimental API. (rustc_private)

A match block, with a source that indicates whether or not it is the result of a desugaring, and if so, which kind.

🔬 This is a nightly-only experimental API. (rustc_private)

A closure (for example, move |a, b, c| {a + b + c}).

The final span is the span of the argument block |...|

🔬 This is a nightly-only experimental API. (rustc_private)

A block ({ ... })

🔬 This is a nightly-only experimental API. (rustc_private)

An assignment (a = foo())

🔬 This is a nightly-only experimental API. (rustc_private)

An assignment with an operator

For example, a += 1.

🔬 This is a nightly-only experimental API. (rustc_private)

Access of a named struct field (obj.foo)

🔬 This is a nightly-only experimental API. (rustc_private)

Access of an unnamed field of a struct or tuple-struct

For example, foo.0.

🔬 This is a nightly-only experimental API. (rustc_private)

An indexing operation (foo[2])

🔬 This is a nightly-only experimental API. (rustc_private)

Path to a definition, possibly containing lifetime or type parameters.

🔬 This is a nightly-only experimental API. (rustc_private)

A referencing operation (&a or &mut a)

🔬 This is a nightly-only experimental API. (rustc_private)

A break, with an optional label to break

🔬 This is a nightly-only experimental API. (rustc_private)

A continue, with an optional label

🔬 This is a nightly-only experimental API. (rustc_private)

A return, with an optional value to be returned

🔬 This is a nightly-only experimental API. (rustc_private)

Inline assembly (from asm!), with its outputs and inputs.

🔬 This is a nightly-only experimental API. (rustc_private)

A struct or struct-like variant literal expression.

For example, Foo {x: 1, y: 2}, or Foo {x: 1, .. base}, where base is the Option<Expr>.

🔬 This is a nightly-only experimental API. (rustc_private)

An array literal constructed from one repeated element.

For example, [1; 5]. The first expression is the element to be repeated; the second is the number of times to repeat it.

Trait Implementations

impl Clone for Expr_
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Expr_
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Expr_
[src]

impl Encodable for Expr_
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

deprecated in favor of rustc-serialize on crates.io

impl Decodable for Expr_
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

deprecated in favor of rustc-serialize on crates.io

impl Hash for Expr_
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl Debug for Expr_
[src]

Formats the value using the given formatter.