Enum rustc_const_eval::interpret::eval_context::LocalValue
source · [−]pub enum LocalValue<Tag: Provenance = AllocId> {
Dead,
Uninitialized,
Live(Operand<Tag>),
}Expand description
Current value of a local variable
Variants
Dead
This local is not currently alive, and cannot be used at all.
Uninitialized
This local is alive but not yet initialized. It can be written to but not read from or its address taken. Locals get initialized on first write because for unsized locals, we do not know their size before that.
Live(Operand<Tag>)
A normal, live local.
Mostly for convenience, we re-use the Operand type here.
This is an optimization over just always having a pointer here;
we can thus avoid doing an allocation when the local just stores
immediate values and never has its address taken.
Trait Implementations
sourceimpl<Tag: Clone + Provenance> Clone for LocalValue<Tag>
impl<Tag: Clone + Provenance> Clone for LocalValue<Tag>
sourcefn clone(&self) -> LocalValue<Tag>
fn clone(&self) -> LocalValue<Tag>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<Tag: Debug + Provenance> Debug for LocalValue<Tag>
impl<Tag: Debug + Provenance> Debug for LocalValue<Tag>
sourceimpl<'__ctx, Tag: Provenance> HashStable<StableHashingContext<'__ctx>> for LocalValue<Tag> where
Tag: HashStable<StableHashingContext<'__ctx>>,
impl<'__ctx, Tag: Provenance> HashStable<StableHashingContext<'__ctx>> for LocalValue<Tag> where
Tag: HashStable<StableHashingContext<'__ctx>>,
fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
sourceimpl<Tag: PartialEq + Provenance> PartialEq<LocalValue<Tag>> for LocalValue<Tag>
impl<Tag: PartialEq + Provenance> PartialEq<LocalValue<Tag>> for LocalValue<Tag>
sourcefn eq(&self, other: &LocalValue<Tag>) -> bool
fn eq(&self, other: &LocalValue<Tag>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &LocalValue<Tag>) -> bool
fn ne(&self, other: &LocalValue<Tag>) -> bool
This method tests for !=.
impl<Tag: Copy + Provenance> Copy for LocalValue<Tag>
impl<Tag: Eq + Provenance> Eq for LocalValue<Tag>
impl<Tag: Provenance> StructuralEq for LocalValue<Tag>
impl<Tag: Provenance> StructuralPartialEq for LocalValue<Tag>
Auto Trait Implementations
impl<Tag> RefUnwindSafe for LocalValue<Tag> where
Tag: RefUnwindSafe,
impl<Tag> Send for LocalValue<Tag> where
Tag: Send,
impl<Tag> Sync for LocalValue<Tag> where
Tag: Sync,
impl<Tag> Unpin for LocalValue<Tag> where
Tag: Unpin,
impl<Tag> UnwindSafe for LocalValue<Tag> where
Tag: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.