Expand description
Thread-local one-shot fault for the try_reserve_exact seam
in the enclosing module. Reachable under
cfg(any(test, feature = "test-components")) so integration
tests in the facade crate can drive the same seam the
crate-internal sibling tests use. FailOnce::install returns
an RAII guard that clears the thread-local on drop so a
panicking assertion does not poison the next test on the
thread.
try_reserve_exact against Vec<()> is the canonical way to
mint a real TryReserveError without unsafe.
Structs§
- Fail
Once - RAII guard that arms a fault on construction and clears it on drop. Use when a test might panic between arming and consuming the fault.
Functions§
- arm_
fault - Replace the thread-local fault with
Some(err). The nexttry_reserve_exactcall consumes it and returnsErr. - synthetic_
err - Synthesize a real
TryReserveError. Asking forusize::MAXelements of a 32-byte type overflows the allocation-size computation inVec::try_reserve_exactand returnsErr(CapacityOverflow)without actually touching the allocator.