]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / consts / const-extern-fn / const-extern-fn-min-const-fn.rs
CommitLineData
e74abb32
XL
1#![feature(const_extern_fn)]
2
3const extern fn unsize(x: &[u8; 3]) -> &[u8] { x }
e74abb32 4const unsafe extern "C" fn closure() -> fn() { || {} }
1b1a35ee
XL
5//~^ ERROR function pointer
6//~| ERROR function pointer cast
e74abb32 7const unsafe extern fn use_float() { 1.0 + 1.0; }
1b1a35ee 8//~^ ERROR floating point arithmetic
e74abb32 9const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
1b1a35ee 10//~^ ERROR casting pointers to integers
e74abb32
XL
11
12
13fn main() {}