Enum rustc::mir::interpret::ConstValue [−][src]
pub enum ConstValue<'tcx> {
Scalar(Scalar),
ScalarPair(Scalar, Scalar),
ByRef(&'tcx Allocation, Size),
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Represents a constant value in Rust. ByVal and ScalarPair are optimizations which matches Value's optimizations for easy conversions between these two types
Variants
Scalar(Scalar)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Used only for types with layout::abi::Scalar ABI and ZSTs which use Scalar::undef()
ScalarPair(Scalar, Scalar)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Used only for types with layout::abi::ScalarPair
ByRef(&'tcx Allocation, Size)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Used only for the remaining cases. An allocation + offset into the allocation
Methods
impl<'tcx> ConstValue<'tcx>[src]
impl<'tcx> ConstValue<'tcx>pub fn from_byval_value(val: Value) -> Self[src]
pub fn from_byval_value(val: Value) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn to_byval_value(&self) -> Option<Value>[src]
pub fn to_byval_value(&self) -> Option<Value>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn from_scalar(val: Scalar) -> Self[src]
pub fn from_scalar(val: Scalar) -> Self🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn to_scalar(&self) -> Option<Scalar>[src]
pub fn to_scalar(&self) -> Option<Scalar>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn to_bits(&self, size: Size) -> Option<u128>[src]
pub fn to_bits(&self, size: Size) -> Option<u128>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn to_ptr(&self) -> Option<Pointer>[src]
pub fn to_ptr(&self) -> Option<Pointer>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Trait Implementations
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ConstValue<'gcx>[src]
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ConstValue<'gcx>fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Clone for ConstValue<'tcx>[src]
impl<'tcx> Clone for ConstValue<'tcx>fn clone(&self) -> ConstValue<'tcx>[src]
fn clone(&self) -> ConstValue<'tcx>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'tcx> Copy for ConstValue<'tcx>[src]
impl<'tcx> Copy for ConstValue<'tcx>impl<'tcx> Debug for ConstValue<'tcx>[src]
impl<'tcx> Debug for ConstValue<'tcx>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'tcx> Eq for ConstValue<'tcx>[src]
impl<'tcx> Eq for ConstValue<'tcx>fn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl<'tcx> PartialEq for ConstValue<'tcx>[src]
impl<'tcx> PartialEq for ConstValue<'tcx>fn eq(&self, other: &ConstValue<'tcx>) -> bool[src]
fn eq(&self, other: &ConstValue<'tcx>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ConstValue<'tcx>) -> bool[src]
fn ne(&self, other: &ConstValue<'tcx>) -> boolThis method tests for !=.
impl<'tcx> PartialOrd for ConstValue<'tcx>[src]
impl<'tcx> PartialOrd for ConstValue<'tcx>fn partial_cmp(&self, other: &ConstValue<'tcx>) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &ConstValue<'tcx>) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &ConstValue<'tcx>) -> bool[src]
fn lt(&self, other: &ConstValue<'tcx>) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &ConstValue<'tcx>) -> bool[src]
fn le(&self, other: &ConstValue<'tcx>) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &ConstValue<'tcx>) -> bool[src]
fn gt(&self, other: &ConstValue<'tcx>) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &ConstValue<'tcx>) -> bool[src]
fn ge(&self, other: &ConstValue<'tcx>) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<'tcx> Ord for ConstValue<'tcx>[src]
impl<'tcx> Ord for ConstValue<'tcx>fn cmp(&self, other: &ConstValue<'tcx>) -> Ordering[src]
fn cmp(&self, other: &ConstValue<'tcx>) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl<'tcx> Encodable for ConstValue<'tcx>[src]
impl<'tcx> Encodable for ConstValue<'tcx>fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Decodable for ConstValue<'tcx>[src]
impl<'tcx> Decodable for ConstValue<'tcx>fn decode<__D: Decoder>(d: &mut __D) -> Result<ConstValue<'tcx>, __D::Error>[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<ConstValue<'tcx>, __D::Error>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl<'tcx> Hash for ConstValue<'tcx>[src]
impl<'tcx> Hash for ConstValue<'tcx>Auto Trait Implementations
impl<'tcx> Send for ConstValue<'tcx>
impl<'tcx> Send for ConstValue<'tcx>impl<'tcx> Sync for ConstValue<'tcx>
impl<'tcx> Sync for ConstValue<'tcx>