You misunderstand the role of Rust&#x27;s standard library. For &quot;libc type roles&quot; you&#x27;d be using libcore, which is a subset of the standard library that does no allocation whatsoever, and allows you to define your own allocators and do whatever you like on allocation failure.