mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
11 lines
293 B
Rust
11 lines
293 B
Rust
|
use core::alloc::Layout;
|
||
|
|
||
|
#[test]
|
||
|
fn const_unchecked_layout() {
|
||
|
const SIZE: usize = 0x2000;
|
||
|
const ALIGN: usize = 0x1000;
|
||
|
const LAYOUT: Layout = unsafe { Layout::from_size_align_unchecked(SIZE, ALIGN) };
|
||
|
assert_eq!(LAYOUT.size(), SIZE);
|
||
|
assert_eq!(LAYOUT.align(), ALIGN);
|
||
|
}
|