Skip to main content

synthetic_err

Function synthetic_err 

Source
pub fn synthetic_err() -> TryReserveError
Expand description

Synthesize a real TryReserveError. Asking for usize::MAX elements of a 32-byte type overflows the allocation-size computation in Vec::try_reserve_exact and returns Err(CapacityOverflow) without actually touching the allocator.