Function alloc::alloc::handle_alloc_error

1.28.0 (const: unstable) · source ·
pub fn handle_alloc_error(layout: Layout) -> !
Expand description

Abort on memory allocation error or failure.

Callers of memory allocation APIs wishing to abort computation in response to an allocation error are encouraged to call this function, rather than directly invoking panic! or similar.