Enum miri::borrow_tracker::tree_borrows::perms::PermissionPriv
source · enum PermissionPriv {
Reserved {
ty_is_freeze: bool,
conflicted: bool,
},
Active,
Frozen,
Disabled,
}
Expand description
The activation states of a pointer.
Variants§
Reserved
represents: a local reference that has not yet been written to; allows: child reads, foreign reads, foreign writes if type is freeze; affected by: child writes (becomes Active), rejects: foreign writes (Disabled, except if type is not freeze).
special case: behaves differently when protected, which is where conflicted
is relevant
conflicted
is set on foreign reads,conflicted
must not be set on child writes (there is UB otherwise). This is so that the behavior ofReserved
adheres to the rules ofnoalias
:- foreign-read then child-write is UB due to
conflicted
, - child-write then foreign-read is UB since child-write will activate and then
foreign-read disables a protected
Active
, which is UB.
Active
represents: a unique pointer; allows: child reads, child writes; rejects: foreign reads (Frozen), foreign writes (Disabled).
Frozen
represents: a shared pointer; allows: all read accesses; rejects child writes (UB), foreign writes (Disabled).
Disabled
represents: a dead pointer; allows: all foreign accesses; rejects: all child accesses (UB).
Implementations§
source§impl PermissionPriv
impl PermissionPriv
sourcefn is_initial(&self) -> bool
fn is_initial(&self) -> bool
Check if self
can be the initial state of a pointer.
Trait Implementations§
source§impl Clone for PermissionPriv
impl Clone for PermissionPriv
source§fn clone(&self) -> PermissionPriv
fn clone(&self) -> PermissionPriv
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PermissionPriv
impl Debug for PermissionPriv
source§impl Display for PermissionPriv
impl Display for PermissionPriv
source§impl Hash for PermissionPriv
impl Hash for PermissionPriv
source§impl PartialEq for PermissionPriv
impl PartialEq for PermissionPriv
source§fn eq(&self, other: &PermissionPriv) -> bool
fn eq(&self, other: &PermissionPriv) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for PermissionPriv
impl PartialOrd for PermissionPriv
source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
PermissionPriv is ordered by the reflexive transitive closure of
Reserved(conflicted=false) < Reserved(conflicted=true) < Active < Frozen < Disabled
.
Reserved
that have incompatible ty_is_freeze
are incomparable to each other.
This ordering matches the reachability by transitions, as asserted by the exhaustive test
permissionpriv_partialord_is_reachability
.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for PermissionPriv
impl Eq for PermissionPriv
impl StructuralEq for PermissionPriv
impl StructuralPartialEq for PermissionPriv
Auto Trait Implementations§
impl RefUnwindSafe for PermissionPriv
impl Send for PermissionPriv
impl Sync for PermissionPriv
impl Unpin for PermissionPriv
impl UnwindSafe for PermissionPriv
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: 2 bytes
Size for each variant:
Reserved
: 2 bytesActive
: 0 bytesFrozen
: 0 bytesDisabled
: 0 bytes