Struct miri::borrow_tracker::tree_borrows::tree::LocationState
source · pub(super) struct LocationState {
permission: Permission,
initialized: bool,
latest_foreign_access: Option<AccessKind>,
}Expand description
Data for a single location.
Fields§
§permission: PermissionThis pointer’s current permission
initialized: boolA location is initialized when it is child accessed for the first time,
and it then stays initialized forever.
Before initialization we still apply some preemptive transitions on
permission to know what to do in case it ever gets initialized,
but these can never cause any immediate UB. There can however be UB
the moment we attempt to initialize (i.e. child-access) because some
foreign access done between the creation and the initialization is
incompatible with child accesses.
latest_foreign_access: Option<AccessKind>Strongest foreign access whose effects have already been applied to
this node and all its children since the last child access.
This is None if the most recent access is a child access,
Some(Write) if at least one foreign write access has been applied
since the previous child access, and Some(Read) if at least one
foreign read and no foreign write have occurred since the last child access.
Implementations§
source§impl LocationState
impl LocationState
sourcefn new(permission: Permission) -> Self
fn new(permission: Permission) -> Self
Default initial state has never been accessed and has been subjected to no foreign access.
sourcefn with_access(self) -> Self
fn with_access(self) -> Self
Record that this location was accessed through a child pointer by marking it as initialized
pub fn is_initialized(&self) -> bool
pub fn permission(&self) -> Permission
Trait Implementations§
source§impl Clone for LocationState
impl Clone for LocationState
source§fn clone(&self) -> LocationState
fn clone(&self) -> LocationState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LocationState
impl Debug for LocationState
source§impl PartialEq<LocationState> for LocationState
impl PartialEq<LocationState> for LocationState
source§fn eq(&self, other: &LocationState) -> bool
fn eq(&self, other: &LocationState) -> bool
self and other values to be equal, and is used
by ==.impl Copy for LocationState
impl Eq for LocationState
impl StructuralEq for LocationState
impl StructuralPartialEq for LocationState
Auto Trait Implementations§
impl RefUnwindSafe for LocationState
impl Send for LocationState
impl Sync for LocationState
impl Unpin for LocationState
impl UnwindSafe for LocationState
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. 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:3 bytes