]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
Update upstream source from tag 'upstream/1.51.0+dfsg1'
[rustc.git] / src / test / 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
12 //~| WARN this was previously accepted by the compiler but is being phased out
13 const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR
14 //~| WARN this was previously accepted by the compiler but is being phased out
15
16 fn main() {}