]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-ptr/ptr_to_usize_cast.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / const-ptr / ptr_to_usize_cast.rs
CommitLineData
6a06907d
XL
1#![feature(const_raw_ptr_to_usize_cast)]
2
3fn main() {
4 const OK: usize = unsafe { 0 as *const i32 as usize };
5
6 const _ERROR: usize = unsafe { &0 as *const i32 as usize };
7 //~^ ERROR [const_err]
8 //~| NOTE cannot cast pointer to integer because it was not created by cast from integer
9 //~| NOTE
10 //~| NOTE `#[deny(const_err)]` on by default
11 //~| WARN this was previously accepted by the compiler but is being phased out
12 //~| NOTE see issue #71800
13}