rust/tests/compile-fail/reallocate-bad-alignment.rs

14 lines
265 B
Rust
Raw Normal View History

#![feature(alloc, heap_api)]
extern crate alloc;
2017-07-10 15:34:54 -05:00
// error-pattern: tried to access memory with alignment 1, but alignment 2 is required
use alloc::heap::*;
fn main() {
unsafe {
let x = allocate(1, 1);
let _y = reallocate(x, 1, 1, 2);
}
}