]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-size_of_val-align_of_val-extern-type.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / consts / const-size_of_val-align_of_val-extern-type.rs
1 #![feature(extern_types)]
2 #![feature(core_intrinsics)]
3 #![feature(const_size_of_val, const_align_of_val)]
4
5 use std::intrinsics::{min_align_of_val, size_of_val};
6
7 extern "C" {
8     type Opaque;
9 }
10
11 const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR constant
12 const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR constant
13
14 fn main() {}