2017-08-07 19:40:18 -05:00
|
|
|
// Validation forces more allocation; disable it.
|
|
|
|
// compile-flags: -Zmir-emit-validate=0
|
2016-10-16 20:58:22 -05:00
|
|
|
#![feature(box_syntax, custom_attribute, attr_literals)]
|
2017-09-25 09:21:20 -05:00
|
|
|
#![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
|
2016-07-05 06:04:53 -05:00
|
|
|
|
2016-10-16 20:58:22 -05:00
|
|
|
fn main() {
|
|
|
|
loop {
|
2017-09-25 09:21:20 -05:00
|
|
|
::std::mem::forget(box 42);
|
2016-07-05 06:04:53 -05:00
|
|
|
}
|
|
|
|
}
|