]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
1 | #![feature(const_raw_ptr_to_usize_cast)] |
2 | ||
3 | fn 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 | } |