summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs')
-rw-r--r--tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
new file mode 100644
index 000000000..c7078e46f
--- /dev/null
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
@@ -0,0 +1,11 @@
+#![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; }
+//~^ 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() {}