pub enum AggregateKind<'tcx> {
Array(Ty<'tcx>),
Tuple,
Adt(DefId, VariantIdx, &'tcx RawList<(), GenericArg<'tcx>>, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
Closure(DefId, &'tcx RawList<(), GenericArg<'tcx>>),
Coroutine(DefId, &'tcx RawList<(), GenericArg<'tcx>>),
CoroutineClosure(DefId, &'tcx RawList<(), GenericArg<'tcx>>),
RawPtr(Ty<'tcx>, Mutability),
}
Variants§
Array(Ty<'tcx>)
The type is of the element
Tuple
Adt(DefId, VariantIdx, &'tcx RawList<(), GenericArg<'tcx>>, Option<UserTypeAnnotationIndex>, Option<FieldIdx>)
The second field is the variant index. It’s equal to 0 for struct
and union expressions. The last field is the
active field number and is present only for union expressions
– e.g., for a union expression SomeUnion { c: .. }
, the
active field index would identity the field c
Closure(DefId, &'tcx RawList<(), GenericArg<'tcx>>)
Coroutine(DefId, &'tcx RawList<(), GenericArg<'tcx>>)
CoroutineClosure(DefId, &'tcx RawList<(), GenericArg<'tcx>>)
RawPtr(Ty<'tcx>, Mutability)
Construct a raw pointer from the data pointer and metadata.
The Ty
here is the type of the pointee, not the pointer itself.
The Mutability
indicates whether this produces a *const
or *mut
.
The Rvalue::Aggregate
operands for thus must be
- A raw pointer of matching mutability with any
core::ptr::Thin
pointee - A value of the appropriate
core::ptr::Pointee::Metadata
type
Both operands must always be included, even the unit value if this is
creating a thin pointer. If you’re just converting between thin pointers,
you may want an Rvalue::Cast
with CastKind::PtrToPtr
instead.
Auto Trait Implementations§
impl<'tcx> Freeze for AggregateKind<'tcx>
impl<'tcx> !RefUnwindSafe for AggregateKind<'tcx>
impl<'tcx> Send for AggregateKind<'tcx>
impl<'tcx> Sync for AggregateKind<'tcx>
impl<'tcx> Unpin for AggregateKind<'tcx>
impl<'tcx> !UnwindSafe for AggregateKind<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more