3d8bf92a11
Required to land https://github.com/rust-lang/rust/pull/68529. Please see that PR for details. The CI is expected to fail until the PR is landed.
16 lines
386 B
Rust
16 lines
386 B
Rust
#![feature(allocator_api)]
|
|
|
|
extern crate alloc;
|
|
|
|
use alloc::alloc::Global;
|
|
use std::alloc::{AllocRef, Layout};
|
|
|
|
// error-pattern: incorrect alloc info: expected size 1 and align 2, got size 1 and align 1
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let x = Global.alloc(Layout::from_size_align_unchecked(1, 1)).unwrap();
|
|
Global.dealloc(x, Layout::from_size_align_unchecked(1, 2));
|
|
}
|
|
}
|