We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7a0520 commit 07e8d84Copy full SHA for 07e8d84
src/libcore/tests/alloc.rs
@@ -0,0 +1,10 @@
1
+use core::alloc::Layout;
2
+
3
+#[test]
4
+fn const_unchecked_layout() {
5
+ const SIZE: usize = 0x2000;
6
+ const ALIGN: usize = 0x1000;
7
+ const LAYOUT: Layout = unsafe { Layout::from_size_align_unchecked(SIZE, ALIGN) };
8
+ assert_eq!(LAYOUT.size(), SIZE);
9
+ assert_eq!(LAYOUT.align(), ALIGN);
10
+}
src/libcore/tests/lib.rs
@@ -31,10 +31,12 @@
31
#![feature(slice_partition_dedup)]
32
#![feature(copy_within)]
33
#![feature(int_error_matching)]
34
+#![feature(const_fn)]
35
#![warn(rust_2018_idioms)]
36
37
extern crate test;
38
39
+mod alloc;
40
mod any;
41
mod array;
42
mod ascii;
0 commit comments