Skip to content

Commit 6e86503

Browse files
committed
fix oom2 test
1 parent a8980fd commit 6e86503

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/compile-fail/oom2.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
// Validation forces more allocation; disable it.
22
// compile-flags: -Zmir-emit-validate=0
33
#![feature(box_syntax, custom_attribute, attr_literals)]
4-
#![miri(memory_size=2048)]
4+
#![miri(memory_size=1024)]
5+
6+
// On 64bit platforms, the allocator needs 32 bytes allocated to pass a return value, so that's the error we see.
7+
// On 32bit platforms, it's just 16 bytes.
8+
// error-pattern: tried to allocate
59

610
fn main() {
711
loop {
8-
::std::mem::forget(box 42); //~ ERROR tried to allocate 4 more bytes
12+
::std::mem::forget(box 42);
913
}
1014
}

0 commit comments

Comments
 (0)