[−][src]Struct rustc_middle::ty::ScalarInt
The raw bytes of a simple value.
This is a packed struct in order to allow this type to be optimally embedded in enums (like Scalar).
Fields
data: u128The first size bytes of data are the value.
Do not try to read less or more bytes than that. The remaining bytes must be 0.
size: u8Implementations
impl ScalarInt[src]
pub const TRUE: ScalarInt[src]
pub const FALSE: ScalarInt[src]
pub const ZST: ScalarInt[src]
pub fn size(self) -> Size[src]
pub(in ty::consts::int) fn check_data(
self
)[src]
self
)
Make sure the data fits in size.
This is guaranteed by all constructors here, but having had this check saved us from
bugs many times in the past, so keeping it around is definitely worth it.
pub fn null(size: Size) -> Self[src]
pub fn is_null(self) -> bool[src]
pub(crate) fn ptr_sized_op<E>(
self,
dl: &TargetDataLayout,
f_int: impl FnOnce(u64) -> Result<u64, E>
) -> Result<Self, E>[src]
self,
dl: &TargetDataLayout,
f_int: impl FnOnce(u64) -> Result<u64, E>
) -> Result<Self, E>
pub fn try_from_uint(i: impl Into<u128>, size: Size) -> Option<Self>[src]
pub fn try_from_int(i: impl Into<i128>, size: Size) -> Option<Self>[src]
pub fn assert_bits(self, target_size: Size) -> u128[src]
pub fn to_bits(self, target_size: Size) -> Result<u128, Size>[src]
Trait Implementations
impl Clone for ScalarInt[src]
impl Copy for ScalarInt[src]
impl Debug for ScalarInt[src]
impl<D: Decoder> Decodable<D> for ScalarInt[src]
impl<S: Encoder> Encodable<S> for ScalarInt[src]
impl Eq for ScalarInt[src]
impl From<IeeeFloat<DoubleS>> for ScalarInt[src]
impl From<IeeeFloat<SingleS>> for ScalarInt[src]
impl From<bool> for ScalarInt[src]
impl From<char> for ScalarInt[src]
impl From<u128> for ScalarInt[src]
impl From<u16> for ScalarInt[src]
impl From<u32> for ScalarInt[src]
impl From<u64> for ScalarInt[src]
impl From<u8> for ScalarInt[src]
impl Hash for ScalarInt[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<CTX> HashStable<CTX> for ScalarInt[src]
pub fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)[src]
impl LowerHex for ScalarInt[src]
impl Ord for ScalarInt[src]
pub fn cmp(&self, other: &ScalarInt) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<ScalarInt> for ScalarInt[src]
impl PartialOrd<ScalarInt> for ScalarInt[src]
pub fn partial_cmp(&self, other: &ScalarInt) -> Option<Ordering>[src]
pub fn lt(&self, other: &ScalarInt) -> bool[src]
pub fn le(&self, other: &ScalarInt) -> bool[src]
pub fn gt(&self, other: &ScalarInt) -> bool[src]
pub fn ge(&self, other: &ScalarInt) -> bool[src]
impl StructuralEq for ScalarInt[src]
impl StructuralPartialEq for ScalarInt[src]
impl TryFrom<ScalarInt> for u8[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for u16[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for u32[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for u64[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for u128[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for char[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for Single[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl TryFrom<ScalarInt> for Double[src]
type Error = Size
The type returned in the event of a conversion error.
pub fn try_from(int: ScalarInt) -> Result<Self, Size>[src]
impl UpperHex for ScalarInt[src]
Auto Trait Implementations
impl RefUnwindSafe for ScalarInt
impl Send for ScalarInt
impl Sync for ScalarInt
impl Unpin for ScalarInt
impl UnwindSafe for ScalarInt
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
T: Copy,
pub fn allocate_on(Self, &'a Arena<'tcx>) -> &'a mut T[src]
pub fn allocate_from_iter(
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T][src]
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: HashStable<<Ctxt as DepContext>::StableHashingContext> + Debug, [src]
Ctxt: DepContext,
T: HashStable<<Ctxt as DepContext>::StableHashingContext> + Debug,
pub default fn can_reconstruct_query_key() -> bool[src]
pub default fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint[src]
pub default fn to_debug_str(&self, Ctxt) -> String[src]
pub default fn recover(
Ctxt,
&DepNode<<Ctxt as DepContext>::DepKind>
) -> Option<T>[src]
Ctxt,
&DepNode<<Ctxt as DepContext>::DepKind>
) -> Option<T>
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> MaybeResult<T> for T[src]
type Error = !
pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]
pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.