rust/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
356 B
Rust
Raw Normal View History

#![feature(const_extern_fn)]
const extern "C" fn unsize(x: &[u8; 3]) -> &[u8] { x }
const unsafe extern "C" fn closure() -> fn() { || {} }
const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
2020-09-23 18:58:41 +00:00
//~^ ERROR floating point arithmetic
const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
//~^ ERROR pointers cannot be cast to integers
fn main() {}