#[non_exhaustive]pub enum AllocError {
NoData,
Leak,
DoubleFree,
BadPtr,
BadSize,
BadAlignment,
BadLayout,
}
Expand description
Types of allocation bug which can be detected by the allocator.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoData
No allocations were detected. Perhaps Mockalloc
isn’t enabled
as the global allocator?
Leak
There were more calls to alloc
than to dealloc
.
DoubleFree
There were more calls to dealloc
than to alloc
.
BadPtr
A pointer was passed to dealloc
which was not previously
returned by alloc
.
BadSize
The size specified in a call to dealloc
did not match that
specified in the corresponding alloc
call.
BadAlignment
The alignment specified in a call to dealloc
did not match that
specified in the corresponding alloc
call.
BadLayout
The size and alignment specified in a call to dealloc
did not match
those specified in the corresponding alloc
call.
Trait Implementations§
Source§impl Clone for AllocError
impl Clone for AllocError
Source§fn clone(&self) -> AllocError
fn clone(&self) -> AllocError
Returns a copy 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 AllocError
impl Debug for AllocError
Source§impl PartialEq for AllocError
impl PartialEq for AllocError
impl StructuralPartialEq for AllocError
Auto Trait Implementations§
impl Freeze for AllocError
impl RefUnwindSafe for AllocError
impl Send for AllocError
impl Sync for AllocError
impl Unpin for AllocError
impl UnwindSafe for AllocError
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