Enum flowistry_pdg::rustc::mir::interpret::ConstValue
source · pub enum ConstValue<'tcx> {
Scalar(Scalar<AllocId>),
ZeroSized,
Slice {
data: ConstAllocation<'tcx>,
start: usize,
end: usize,
},
ByRef {
alloc: ConstAllocation<'tcx>,
offset: Size,
},
}
Expand description
Represents a constant value in Rust. Scalar
and Slice
are optimizations for
array length computations, enum discriminants and the pattern matching logic.
Variants§
Scalar(Scalar<AllocId>)
Used only for types with layout::abi::Scalar
ABI.
Not using the enum Value
to encode that this must not be Uninit
.
ZeroSized
Only used for ZSTs.
Slice
Used only for &[u8]
and &str
ByRef
Fields
§
alloc: ConstAllocation<'tcx>
The backing memory of the value, may contain more memory than needed for just the value
in order to share ConstAllocation
s between values
§
offset: Size
Offset into alloc
A value not represented/representable by Scalar
or Slice
Auto Trait Implementations§
impl<'tcx> RefUnwindSafe for ConstValue<'tcx>
impl<'tcx> Send for ConstValue<'tcx>
impl<'tcx> Sync for ConstValue<'tcx>
impl<'tcx> Unpin for ConstValue<'tcx>
impl<'tcx> UnwindSafe for ConstValue<'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