Enum rustc::mir::Rvalue
[−]
[src]
pub enum Rvalue<'tcx> { Use(Operand<'tcx>), Repeat(Operand<'tcx>, ConstUsize), Ref(&'tcx Region, BorrowKind, Lvalue<'tcx>), Len(Lvalue<'tcx>), Cast(CastKind, Operand<'tcx>, Ty<'tcx>), BinaryOp(BinOp, Operand<'tcx>, Operand<'tcx>), CheckedBinaryOp(BinOp, Operand<'tcx>, Operand<'tcx>), UnaryOp(UnOp, Operand<'tcx>), Discriminant(Lvalue<'tcx>), Box(Ty<'tcx>), Aggregate(AggregateKind<'tcx>, Vec<Operand<'tcx>>), }
rustc_private
)Rvalues
Variants
Use(Operand<'tcx>)
rustc_private
)x (either a move or copy, depending on type of x)
Repeat(Operand<'tcx>, ConstUsize)
rustc_private
)[x; 32]
Ref(&'tcx Region, BorrowKind, Lvalue<'tcx>)
rustc_private
)&x or &mut x
Len(Lvalue<'tcx>)
rustc_private
)length of a [X] or [X;n] value
Cast(CastKind, Operand<'tcx>, Ty<'tcx>)
rustc_private
)BinaryOp(BinOp, Operand<'tcx>, Operand<'tcx>)
rustc_private
)CheckedBinaryOp(BinOp, Operand<'tcx>, Operand<'tcx>)
rustc_private
)UnaryOp(UnOp, Operand<'tcx>)
rustc_private
)Discriminant(Lvalue<'tcx>)
rustc_private
)Read the discriminant of an ADT.
Undefined (i.e. no effort is made to make it defined, but there’s no reason why it cannot be defined to return, say, a 0) if ADT is not an enum.
Box(Ty<'tcx>)
rustc_private
)Creates an uninitialized Box
Aggregate(AggregateKind<'tcx>, Vec<Operand<'tcx>>)
rustc_private
)Create an aggregate value, like a tuple or struct. This is
only needed because we want to distinguish dest = Foo { x: ..., y: ... }
from dest.x = ...; dest.y = ...;
in the case
that Foo
has a destructor. These rvalues can be optimized
away after type-checking and before lowering.
Methods
impl<'tcx> Rvalue<'tcx>
[src]
fn ty<'a, 'gcx>(&self, mir: &Mir<'tcx>, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Ty<'tcx>
rustc_private
)Trait Implementations
impl<'tcx> Clone for Rvalue<'tcx>
[src]
fn clone(&self) -> Rvalue<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'tcx> Encodable for Rvalue<'tcx>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> Decodable for Rvalue<'tcx>
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Rvalue<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> Debug for Rvalue<'tcx>
[src]
impl<'tcx> TypeFoldable<'tcx> for Rvalue<'tcx>
[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self,
folder: &mut F)
-> Self
folder: &mut F)
-> Self
rustc_private
)fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
rustc_private
)fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self,
folder: &mut F)
-> Self
folder: &mut F)
-> Self
rustc_private
)fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
rustc_private
)fn has_regions_escaping_depth(&self, depth: u32) -> bool
rustc_private
)fn has_escaping_regions(&self) -> bool
rustc_private
)fn has_type_flags(&self, flags: TypeFlags) -> bool
rustc_private
)fn has_projection_types(&self) -> bool
rustc_private
)fn references_error(&self) -> bool
rustc_private
)fn has_param_types(&self) -> bool
rustc_private
)fn has_self_ty(&self) -> bool
rustc_private
)fn has_infer_types(&self) -> bool
rustc_private
)fn needs_infer(&self) -> bool
rustc_private
)fn needs_subst(&self) -> bool
rustc_private
)fn has_re_skol(&self) -> bool
rustc_private
)fn has_closure_types(&self) -> bool
rustc_private
)fn has_erasable_regions(&self) -> bool
rustc_private
)fn is_normalized_for_trans(&self) -> bool
rustc_private
)fn is_global(&self) -> bool
rustc_private
)Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Errs on the side of returning false. Read more