Struct miri::borrow_tracker::tree_borrows::NewPermission
source · struct NewPermission {
zero_size: bool,
initial_state: Permission,
protector: Option<ProtectorKind>,
}
Expand description
Policy for a new borrow.
Fields§
§zero_size: bool
Optionally ignore the actual size to do a zero-size reborrow.
If this is set then dereferenceable
is not enforced.
initial_state: Permission
Which permission should the pointer start with.
protector: Option<ProtectorKind>
Whether this pointer is part of the arguments of a function call.
protector
is Some(_)
for all pointers marked noalias
.
Implementations§
source§impl<'tcx> NewPermission
impl<'tcx> NewPermission
sourcefn from_ref_ty(
pointee: Ty<'tcx>,
mutability: Mutability,
kind: RetagKind,
cx: &MiriInterpCx<'tcx>,
) -> Option<Self>
fn from_ref_ty( pointee: Ty<'tcx>, mutability: Mutability, kind: RetagKind, cx: &MiriInterpCx<'tcx>, ) -> Option<Self>
Determine NewPermission of the reference from the type of the pointee.
sourcefn from_unique_ty(
ty: Ty<'tcx>,
kind: RetagKind,
cx: &MiriInterpCx<'tcx>,
zero_size: bool,
) -> Option<Self>
fn from_unique_ty( ty: Ty<'tcx>, kind: RetagKind, cx: &MiriInterpCx<'tcx>, zero_size: bool, ) -> Option<Self>
Compute permission for Box
-like type (Box
always, and also Unique
if enabled).
These pointers allow deallocation so need a different kind of protector not handled
by from_ref_ty
.
Trait Implementations§
source§impl Clone for NewPermission
impl Clone for NewPermission
source§fn clone(&self) -> NewPermission
fn clone(&self) -> NewPermission
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NewPermission
impl Debug for NewPermission
impl Copy for NewPermission
Auto Trait Implementations§
impl Freeze for NewPermission
impl RefUnwindSafe for NewPermission
impl Send for NewPermission
impl Sync for NewPermission
impl Unpin for NewPermission
impl UnwindSafe for NewPermission
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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