Enum rustc::hir::Expr_
[−]
[src]
pub enum Expr_ {
ExprBox(P<Expr>),
ExprArray(HirVec<Expr>),
ExprCall(P<Expr>, HirVec<Expr>),
ExprMethodCall(PathSegment, Span, HirVec<Expr>),
ExprTup(HirVec<Expr>),
ExprBinary(BinOp, P<Expr>, P<Expr>),
ExprUnary(UnOp, P<Expr>),
ExprLit(P<Lit>),
ExprCast(P<Expr>, P<Ty>),
ExprType(P<Expr>, P<Ty>),
ExprIf(P<Expr>, P<Expr>, 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(CaptureClause, P<FnDecl>, BodyId, Span, bool),
ExprBlock(P<Block>),
ExprAssign(P<Expr>, P<Expr>),
ExprAssignOp(BinOp, P<Expr>, P<Expr>),
ExprField(P<Expr>, Spanned<Name>),
ExprTupField(P<Expr>, Spanned<usize>),
ExprIndex(P<Expr>, P<Expr>),
ExprPath(QPath),
ExprAddrOf(Mutability, P<Expr>),
ExprBreak(Destination, Option<P<Expr>>),
ExprAgain(Destination),
ExprRet(Option<P<Expr>>),
ExprInlineAsm(P<InlineAsm>, HirVec<Expr>, HirVec<Expr>),
ExprStruct(QPath, HirVec<Field>, Option<P<Expr>>),
ExprRepeat(P<Expr>, BodyId),
ExprYield(P<Expr>),
}🔬 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?
Variants
ExprBox(P<Expr>)🔬 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?
A box x expression.
ExprArray(HirVec<Expr>)🔬 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?
An array ([a, b, c, d])
ExprCall(P<Expr>, HirVec<Expr>)🔬 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?
A function call
The first field resolves to the function itself (usually an ExprPath),
and the second field is the list of arguments.
This also represents calling the constructor of
tuple-like ADTs such as tuple structs and enum variants.
ExprMethodCall(PathSegment, Span, HirVec<Expr>)🔬 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?
A method call (x.foo::<'static, Bar, Baz>(a, b, c, d))
The PathSegment/Span represent the method name and its generic arguments
(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
ExprKind::MethodCall(PathSegment { foo, [Bar, Baz] }, [x, a, b, c, d]).
ExprTup(HirVec<Expr>)🔬 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?
A tuple ((a, b, c ,d))
ExprBinary(BinOp, P<Expr>, P<Expr>)🔬 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?
A binary operation (For example: a + b, a * b)
ExprUnary(UnOp, P<Expr>)🔬 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?
A unary operation (For example: !x, *x)
ExprLit(P<Lit>)🔬 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?
A literal (For example: 1, "foo")
ExprCast(P<Expr>, P<Ty>)🔬 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?
A cast (foo as f64)
ExprType(P<Expr>, P<Ty>)🔬 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?
ExprIf(P<Expr>, P<Expr>, Option<P<Expr>>)🔬 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?
An if block, with an optional else block
if expr { expr } else { expr }
ExprWhile(P<Expr>, P<Block>, Option<Spanned<Name>>)🔬 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?
A while loop, with an optional label
'label: while expr { block }
ExprLoop(P<Block>, Option<Spanned<Name>>, LoopSource)🔬 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?
Conditionless loop (can be exited with break, continue, or return)
'label: loop { block }
ExprMatch(P<Expr>, HirVec<Arm>, MatchSource)🔬 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?
A match block, with a source that indicates whether or not it is
the result of a desugaring, and if so, which kind.
ExprClosure(CaptureClause, P<FnDecl>, BodyId, Span, bool)🔬 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?
A closure (for example, move |a, b, c| {a + b + c}).
The final span is the span of the argument block |...|
This may also be a generator literal, indicated by the final boolean, in that case there is an GeneratorClause.
ExprBlock(P<Block>)🔬 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?
A block ({ ... })
ExprAssign(P<Expr>, P<Expr>)🔬 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?
An assignment (a = foo())
ExprAssignOp(BinOp, P<Expr>, P<Expr>)🔬 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?
An assignment with an operator
For example, a += 1.
ExprField(P<Expr>, Spanned<Name>)🔬 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?
Access of a named struct field (obj.foo)
ExprTupField(P<Expr>, Spanned<usize>)🔬 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?
Access of an unnamed field of a struct or tuple-struct
For example, foo.0.
ExprIndex(P<Expr>, P<Expr>)🔬 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?
An indexing operation (foo[2])
ExprPath(QPath)🔬 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?
Path to a definition, possibly containing lifetime or type parameters.
ExprAddrOf(Mutability, P<Expr>)🔬 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?
A referencing operation (&a or &mut a)
ExprBreak(Destination, Option<P<Expr>>)🔬 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?
A break, with an optional label to break
ExprAgain(Destination)🔬 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?
A continue, with an optional label
ExprRet(Option<P<Expr>>)🔬 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?
A return, with an optional value to be returned
ExprInlineAsm(P<InlineAsm>, HirVec<Expr>, HirVec<Expr>)🔬 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?
Inline assembly (from asm!), with its outputs and inputs.
ExprStruct(QPath, HirVec<Field>, Option<P<Expr>>)🔬 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?
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>.
ExprRepeat(P<Expr>, BodyId)🔬 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?
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.
ExprYield(P<Expr>)🔬 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?
A suspension point for generators. This is yield <expr> in Rust.
Trait Implementations
impl Clone for Expr_[src]
fn clone(&self) -> Expr_[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq for Expr_[src]
fn eq(&self, __arg_0: &Expr_) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Expr_) -> bool[src]
This method tests for !=.
impl Eq for Expr_[src]
impl Encodable for Expr_[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>[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 Decodable for Expr_[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Expr_, __D::Error>[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 Hash for Expr_[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for Expr_[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl<'tcx> HashStable<StableHashingContext<'tcx>> for Expr_[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)[src]
&self,
__ctx: &mut StableHashingContext<'tcx>,
__hasher: &mut StableHasher<W>
)
🔬 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?