2019-09-29 23:22:18 +00:00
|
|
|
#![feature(const_extern_fn)]
|
|
|
|
|
2020-09-01 21:28:11 +00:00
|
|
|
const extern "C" fn unsize(x: &[u8; 3]) -> &[u8] { x }
|
2019-09-29 23:22:18 +00:00
|
|
|
const unsafe extern "C" fn closure() -> fn() { || {} }
|
2020-09-24 23:18:41 +00:00
|
|
|
//~^ ERROR function pointer
|
2020-09-30 01:32:38 +00:00
|
|
|
//~| ERROR function pointer cast
|
2020-09-01 21:28:11 +00:00
|
|
|
const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
|
2020-09-23 18:58:41 +00:00
|
|
|
//~^ ERROR floating point arithmetic
|
2019-09-29 23:22:18 +00:00
|
|
|
const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
|
2020-09-17 17:32:07 +00:00
|
|
|
//~^ ERROR casting pointers to integers
|
2019-09-29 23:22:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
fn main() {}
|