Could we support unwinding from OOM, at least for collections?

Even #![feature(panic_on_oom)] or #![feature(abort_on_oom)] as an API-less option to change the OOM behavior would be enough for me.

I realize I might (in theory) uncover libstd bugs, but I don’t expect a vector to be usable after an OOM situation; I’m likely rebooting the entire task. Trying to access data structures after an exception is a no-no in every other language; why would I try to do it in Rust? I know Rust wants to offer different guarantees, an is held to a different standard - but then, let’s tackle those specific cases by exercising malloc failure.

Here’s the tracking issue for this topic: https://github.com/rust-lang/rust/issues/27700

1 Like