pub struct PointsTowithDealloc<T> {
pub points_to: PointsTo<T>,
pub dealloc: Option<Dealloc>,
}Fields§
§points_to: PointsTo<T>§dealloc: Option<Dealloc>Implementations§
Source§impl<T> PointsTowithDealloc<T>
impl<T> PointsTowithDealloc<T>
Sourcepub open spec fn dealloc_aligned(self) -> bool
pub open spec fn dealloc_aligned(self) -> bool
{
match self.dealloc {
Some(dealloc) => dealloc.align() == vstd::layout::align_of::<T>(),
None => true,
}
}Sourcepub proof fn tracked_borrow_points_to(tracked &self) -> tracked ret : &PointsTo<T>
pub proof fn tracked_borrow_points_to(tracked &self) -> tracked ret : &PointsTo<T>
Sourcepub proof fn tracked_get_points_to(tracked self) -> tracked ret : PointsTo<T>
pub proof fn tracked_get_points_to(tracked self) -> tracked ret : PointsTo<T>
Sourcepub proof fn new(tracked points_to: PointsTo<T>, tracked dealloc: Option<Dealloc>) -> tracked ret : Self
pub proof fn new(tracked points_to: PointsTo<T>, tracked dealloc: Option<Dealloc>) -> tracked ret : Self
requires
match dealloc {
Some(dealloc) => (
&&& vstd::layout::size_of::<T>() > 0
&&& valid_layout(size_of::<T>(), dealloc.align() as usize)
&&& points_to.ptr().addr() == dealloc.addr()
&&& points_to.ptr()@.provenance == dealloc.provenance()
&&& dealloc.size() == vstd::layout::size_of::<T>()
),
None => vstd::layout::size_of::<T>() == 0,
},ensuresret.inv(),Sourcepub proof fn new_non_zero_size(tracked points_to: PointsTo<T>, tracked dealloc: Dealloc) -> tracked ret : Self
pub proof fn new_non_zero_size(tracked points_to: PointsTo<T>, tracked dealloc: Dealloc) -> tracked ret : Self
requires
0 < vstd::layout::size_of::<T>(),valid_layout(size_of::<T>(), dealloc.align() as usize),points_to.ptr().addr() == dealloc.addr(),points_to.ptr()@.provenance == dealloc.provenance(),dealloc.size() == vstd::layout::size_of::<T>() as int,dealloc.align() == vstd::layout::align_of::<T>(),ensuresret.inv(),Sourcepub proof fn new_zero_size(tracked points_to: PointsTo<T>) -> tracked ret : Self
pub proof fn new_zero_size(tracked points_to: PointsTo<T>) -> tracked ret : Self
requires
vstd::layout::size_of::<T>() == 0,ensuresret.inv(),Sourcepub proof fn into_raw(tracked self) -> tracked ret : (PointsToRaw, Option<Dealloc>)
pub proof fn into_raw(tracked self) -> tracked ret : (PointsToRaw, Option<Dealloc>)
requires
self.inv(),self.is_uninit(),ensuresmatch ret.1 {
Some(dealloc) => (
&&& vstd::layout::size_of::<T>() > 0
&&& dealloc.addr() == self.addr()
&&& dealloc.addr() as int % vstd::layout::align_of::<T>() as int == 0
&&& dealloc.size() == vstd::layout::size_of::<T>() as int
&&& dealloc.provenance() == ret.0.provenance()
&&& ret.0.is_range(dealloc.addr() as int, vstd::layout::size_of::<T>() as int)
),
None => (
&&& vstd::layout::size_of::<T>() == 0
),
},Trait Implementations§
Source§impl<T> Inv for PointsTowithDealloc<T>
impl<T> Inv for PointsTowithDealloc<T>
Source§open spec fn inv(self) -> bool
open spec fn inv(self) -> bool
{
&&& self.points_to.ptr().addr() as int % vstd::layout::align_of::<T>() as int == 0
&&& match self.dealloc {
Some(dealloc) => (
&&& vstd::layout::size_of::<T>() > 0
&&& self.points_to.ptr().addr() == dealloc.addr()
&&& self.points_to.ptr()@.provenance == dealloc.provenance()
&&& dealloc.size() == vstd::layout::size_of::<T>()
&&& valid_layout(size_of::<T>(), dealloc.align() as usize)
),
None => vstd::layout::size_of::<T>() == 0,
}
}Auto Trait Implementations§
impl<T> Freeze for PointsTowithDealloc<T>
impl<T> RefUnwindSafe for PointsTowithDealloc<T>where
T: RefUnwindSafe,
impl<T> Send for PointsTowithDealloc<T>where
T: Send,
impl<T> Sync for PointsTowithDealloc<T>where
T: Sync,
impl<T> Unpin for PointsTowithDealloc<T>where
T: Unpin,
impl<T> UnwindSafe for PointsTowithDealloc<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more