rust/tests/compile-fail/oom2.rs
Ralf Jung 668491a892 Work on making validation test pass again
Turns out that tracking write locks by their lifetime is not precise enough,
but for now, we don't have an alternative.  Also, we need to force_allocate
what we acquire or else the memory will not be in the right state.
2017-08-09 15:49:47 -07:00

11 lines
283 B
Rust

// Validation forces more allocation; disable it.
// compile-flags: -Zmir-emit-validate=0
#![feature(box_syntax, custom_attribute, attr_literals)]
#![miri(memory_size=2048)]
fn main() {
loop {
::std::mem::forget(box 42); //~ ERROR tried to allocate 4 more bytes
}
}