pub enum MemorySafetyProof {
AllocProof {
viewtype: String,
},
FreeProof {
ptr_id: String,
},
BorrowProof {
ptr_id: String,
mutable: bool,
},
BoundsProof {
buffer_id: String,
index_expr: String,
},
NullCheckProof {
ptr_id: String,
},
}Expand description
A compile-time proof that a memory operation is safe.
ATS2 requires explicit proof terms for memory operations. Each proof corresponds to a specific safety property:
- AllocProof: the allocation succeeded (non-null for non-nullable types)
- FreeProof: the pointer is valid and owned, so freeing is safe
- BorrowProof: the pointer is valid for the duration of the borrow
- BoundsProof: array index is within the allocated bounds
- NullCheckProof: a nullable pointer has been checked for NULL
Variants§
AllocProof
Proves that an allocation returned a valid (non-null) pointer.
FreeProof
Proves that a pointer is valid and owned, permitting deallocation.
BorrowProof
Proves that a borrowed pointer remains valid for the borrow’s scope.
Fields
BoundsProof
Proves that an index is within the bounds of a sized buffer.
NullCheckProof
Proves that a nullable pointer has been checked for NULL.
Implementations§
Source§impl MemorySafetyProof
impl MemorySafetyProof
Sourcepub fn to_ats2_proof(&self) -> String
pub fn to_ats2_proof(&self) -> String
Generates the ATS2 proof term string for this proof.
Trait Implementations§
Source§impl Clone for MemorySafetyProof
impl Clone for MemorySafetyProof
Source§fn clone(&self) -> MemorySafetyProof
fn clone(&self) -> MemorySafetyProof
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemorySafetyProof
impl Debug for MemorySafetyProof
Source§impl<'de> Deserialize<'de> for MemorySafetyProof
impl<'de> Deserialize<'de> for MemorySafetyProof
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MemorySafetyProof
impl PartialEq for MemorySafetyProof
Source§impl Serialize for MemorySafetyProof
impl Serialize for MemorySafetyProof
impl Eq for MemorySafetyProof
impl StructuralPartialEq for MemorySafetyProof
Auto Trait Implementations§
impl Freeze for MemorySafetyProof
impl RefUnwindSafe for MemorySafetyProof
impl Send for MemorySafetyProof
impl Sync for MemorySafetyProof
impl Unpin for MemorySafetyProof
impl UnsafeUnpin for MemorySafetyProof
impl UnwindSafe for MemorySafetyProof
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.