]> git.lizzy.rs Git - rust.git/commitdiff
fix oom2 test
authorRalf Jung <post@ralfj.de>
Mon, 25 Sep 2017 14:21:20 +0000 (16:21 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 25 Sep 2017 14:21:20 +0000 (16:21 +0200)
tests/compile-fail/oom2.rs

index f439ac8c130e5c958a1b91d870966ac62b8132be..6c973bcf4016ddfba9b859b4ceaacaa35244c135 100644 (file)
@@ -1,10 +1,14 @@
 // Validation forces more allocation; disable it.
 // compile-flags: -Zmir-emit-validate=0
 #![feature(box_syntax, custom_attribute, attr_literals)]
-#![miri(memory_size=2048)]
+#![miri(memory_size=1024)]
+
+// On 64bit platforms, the allocator needs 32 bytes allocated to pass a return value, so that's the error we see.
+// On 32bit platforms, it's just 16 bytes.
+// error-pattern: tried to allocate
 
 fn main() {
     loop {
-        ::std::mem::forget(box 42); //~ ERROR tried to allocate 4 more bytes
+        ::std::mem::forget(box 42);
     }
 }