[−][src]Enum checkers::Violation
A single violation in the variants enforced by checkers.
Variants
A region produced by the allocator requested
, overlaps with at least
on existing
allocation.
Fields of ConflictingAlloc
A region produced by the allocator requested
was not zeroed as
expected.
Fields of NonZeroedAlloc
requested: Region
The allocated region.
A region reallocatoed by the allocator was not copied appropriately.
Meaning, the prefixing bytes between free
and alloc
do not match.
Allocator was asked to reallocate a null pointer.
Fields of ReallocNull
A region produced by the allocator requested
was not aligned
appropriately.
Fields of MisalignedAlloc
requested: Region
The allocated region.
A freed region requested
only freed part of at least one other region
existing
.
A freed region requested
provided the wrong alignment metadata.
See std::alloc::Layout::align.
A freed region requested
was not allocated at the time it was freed.
Fields of MissingFree
requested: Region
The freed region.
A region
was leaked. In that it was allocated but never freed.
Fields of Leaked
region: Region
The leaked region.
Implementations
impl Violation
[src]
A single violation to the virtual memory model of checkers.
pub fn is_leaked_with<F>(&self, f: F) -> bool where
F: FnOnce(Region) -> bool,
[src]
F: FnOnce(Region) -> bool,
Test that this violation refers to a dangling region and that it matches the given predicate.
Examples
let violation = Violation::Leaked { region: Region::new(42.into(), 20, 4), }; assert!(violation.is_leaked_with(|r| r.size == 20 && r.align == 4)); let requested = Region::new(10.into(), 10, 1); let violation = Violation::MisalignedAlloc { requested }; assert!(!violation.is_leaked_with(|r| true));
Trait Implementations
impl Clone for Violation
[src]
impl Debug for Violation
[src]
impl Display for Violation
[src]
impl Eq for Violation
[src]
impl PartialEq<Violation> for Violation
[src]
impl StructuralEq for Violation
[src]
impl StructuralPartialEq for Violation
[src]
Auto Trait Implementations
impl RefUnwindSafe for Violation
[src]
impl Send for Violation
[src]
impl Sync for Violation
[src]
impl Unpin for Violation
[src]
impl UnwindSafe for Violation
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,