summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs')
-rw-r--r--src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
new file mode 100644
index 000000000..665371777
--- /dev/null
+++ b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
@@ -0,0 +1,16 @@
+#![feature(extern_types)]
+#![feature(core_intrinsics)]
+#![feature(const_size_of_val, const_align_of_val)]
+
+use std::intrinsics::{min_align_of_val, size_of_val};
+
+extern "C" {
+ type Opaque;
+}
+
+const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR
+//~| WARN this was previously accepted by the compiler but is being phased out
+const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR
+//~| WARN this was previously accepted by the compiler but is being phased out
+
+fn main() {}