rust/src/test/ui/consts/issue-51559.rs

8 lines
214 B
Rust
Raw Normal View History

2019-07-24 07:09:26 -05:00
#![feature(const_raw_ptr_to_usize_cast)]
const BAR: *mut () = ((|| 3) as fn() -> i32) as *mut ();
pub const FOO: usize = unsafe { BAR as usize };
2019-08-01 02:12:48 -05:00
//~^ ERROR any use of this value will cause an error
2019-07-24 07:09:26 -05:00
fn main() {}