Enum rustc_middle::mir::interpret::value::ConstValue [−][src]
pub enum ConstValue<'tcx> {
Scalar(Scalar),
Slice {
data: &'tcx Allocation,
start: usize,
end: usize,
},
ByRef {
alloc: &'tcx Allocation,
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)Used only for types with layout::abi::Scalar ABI and ZSTs.
Not using the enum Value to encode that this must not be Uninit.
Used only for &[u8] and &str
Show fields
Fields of Slice
A value not represented/representable by Scalar or Slice
Show fields
Fields of ByRef
alloc: &'tcx AllocationThe backing memory of the value, may contain more memory than needed for just the value
in order to share Allocations between values
offset: SizeOffset into alloc
Implementations
Trait Implementations
type Lifted = ConstValue<'tcx>This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
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
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. 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: 32 bytes