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>)

Tuple Fields

0: Operand<'tcx>
1: &'tcx Const<'tcx>

[x; 32]

Ref(&'tcx RegionKind, BorrowKind, Place<'tcx>)

Tuple Fields

0: &'tcx RegionKind
2: Place<'tcx>

&x or &mut x

ThreadLocalRef(DefId)

Tuple Fields

0: DefId

Accessing 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>)

Tuple Fields

1: 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>)

Tuple Fields

1: Operand<'tcx>
2: &'tcx TyS<'tcx>

BinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>), Global>)

Tuple Fields

0: BinOp
1: Box<(Operand<'tcx>, Operand<'tcx>), Global>

CheckedBinaryOp(BinOp, Box<(Operand<'tcx>, Operand<'tcx>), Global>)

Tuple Fields

0: BinOp
1: Box<(Operand<'tcx>, Operand<'tcx>), Global>

NullaryOp(NullOp, &'tcx TyS<'tcx>)

Tuple Fields

0: NullOp
1: &'tcx TyS<'tcx>

UnaryOp(UnOp, Operand<'tcx>)

Tuple Fields

0: UnOp
1: 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>)

Tuple Fields

1: 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>)

Tuple Fields

0: Operand<'tcx>
1: &'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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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: