rust/tests/compile-fail/reallocate-bad-alignment.rs
2017-07-10 13:34:54 -07:00

14 lines
265 B
Rust

#![feature(alloc, heap_api)]
extern crate alloc;
// 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);
}
}