3 ms·
Rust's standard library assumes that allocation will not fail. That's just a library; the language doesn't inherently know things about heap allocation. You can
by steveklabnik 9y ago
Rust's standard library assumes that allocation will not fail. That's just a library; the language doesn't inherently know things about heap allocation. You can always call an alllocator directly and look at what it returns.
Furthermore, we're working on an allocator interface that you could use with stdlib stuff that would let you handle it.
The TL;DR is basically "if you want to, you can. It's going to be even easier in the future."