Enum rustc_borrowck::Rvalue [−][src]
pub(crate) enum Rvalue<'tcx> {
Show 14 variants
Use(Operand<'tcx>),
Repeat(Operand<'tcx>, &'tcx Const<'tcx>),
Ref(&'tcx RegionKind, BorrowKind, Place<'tcx>),
ThreadLocalRef(DefId),
AddressOf(Mutability, Place<'tcx>),
Len(Place<'tcx>),
Cast(CastKind, Operand<'tcx>, &'tcx TyS<'tcx>),
BinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>), Global>),
CheckedBinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>), Global>),
NullaryOp(NullOp, &'tcx TyS<'tcx>),
UnaryOp(UnOp, Operand<'tcx>),
Discriminant(Place<'tcx>),
Aggregate(Box<AggregateKind<'tcx>, Global>, Vec<Operand<'tcx>, Global>),
ShallowInitBox(Operand<'tcx>, &'tcx TyS<'tcx>),
}Expand description
Rvalues
Variants
Use(Operand<'tcx>)
Tuple Fields
0: Operand<'tcx>x (either a move or copy, depending on type of x)
Repeat(Operand<'tcx>, &'tcx Const<'tcx>)
[x; 32]
Ref(&'tcx RegionKind, BorrowKind, Place<'tcx>)
&x or &mut x
ThreadLocalRef(DefId)
Tuple Fields
0: DefIdAccessing a thread local static. This is inherently a runtime operation, even if llvm
treats it as an access to a static. This Rvalue yields a reference to the thread local
static.
AddressOf(Mutability, Place<'tcx>)
Create a raw pointer to the given place
Can be generated by raw address of expressions (&raw const x),
or when casting a reference to a raw pointer.
Len(Place<'tcx>)
Tuple Fields
0: Place<'tcx>length of a [X] or [X;n] value
Cast(CastKind, Operand<'tcx>, &'tcx TyS<'tcx>)
BinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>), Global>)
CheckedBinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>), Global>)
NullaryOp(NullOp, &'tcx TyS<'tcx>)
UnaryOp(UnOp, Operand<'tcx>)
Discriminant(Place<'tcx>)
Tuple Fields
0: Place<'tcx>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.
Aggregate(Box<AggregateKind<'tcx>, Global>, Vec<Operand<'tcx>, Global>)
Creates 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.
ShallowInitBox(Operand<'tcx>, &'tcx TyS<'tcx>)
Transmutes a *mut u8 into shallow-initialized Box<T>.
This is different a normal transmute because dataflow analysis will treat the box as initialized but its content as uninitialized.
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for Rvalue<'tcx>
impl<'tcx> !UnwindSafe for Rvalue<'tcx>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn subst_spanned(
self,
tcx: TyCtxt<'tcx>,
substs: &[GenericArg<'tcx>],
span: Option<Span>
) -> T
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes
Size for each variant:
Use: 31 bytesRepeat: 39 bytesRef: 31 bytesThreadLocalRef: 11 bytesAddressOf: 23 bytesLen: 23 bytesCast: 39 bytesBinaryOp: 15 bytesCheckedBinaryOp: 15 bytesNullaryOp: 15 bytesUnaryOp: 31 bytesDiscriminant: 23 bytesAggregate: 39 bytesShallowInitBox: 39 bytes