]> git.lizzy.rs Git - rust.git/commit
Auto merge of #86255 - Smittyvb:mir-alloc-oom, r=RalfJung,oli-obk
authorbors <bors@rust-lang.org>
Sun, 4 Jul 2021 09:15:36 +0000 (09:15 +0000)
committerbors <bors@rust-lang.org>
Sun, 4 Jul 2021 09:15:36 +0000 (09:15 +0000)
commit39e20f1ae5f13451eb35247808d6a2527cb7d060
treef2b3344bf588d88fc7ffadd6c310b430bf6d15d7
parent64ae15ddd3f3cca7036ab2b2f3a6b130b62af4da
parentd83c46ffcc57eab48249476344982b8f5ae1f263
Auto merge of #86255 - Smittyvb:mir-alloc-oom, r=RalfJung,oli-obk

Support allocation failures when interpreting MIR

This closes #79601 by handling the case where memory allocation fails during MIR interpretation, and translates that failure into an `InterpError`. The error message is "tried to allocate more memory than available to compiler" to make it clear that the memory shortage is happening at compile-time by the compiler itself, and that it is not a runtime issue.

Now that memory allocation can fail, it would be neat if Miri could simulate low-memory devices to make it easy to see how much memory a Rust program needs.

Note that this breaks Miri because it assumes that allocation can never fail.