about summary refs log tree commit diff
path: root/tests/ui/consts/const-fn-ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-fn-ptr.rs')
-rw-r--r--tests/ui/consts/const-fn-ptr.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/consts/const-fn-ptr.rs b/tests/ui/consts/const-fn-ptr.rs
new file mode 100644
index 00000000000..b1befdf06af
--- /dev/null
+++ b/tests/ui/consts/const-fn-ptr.rs
@@ -0,0 +1,16 @@
+const fn make_fn_ptr() -> fn() {
+    || {}
+}
+
+static STAT: () = make_fn_ptr()();
+//~^ ERROR function pointer
+
+const CONST: () = make_fn_ptr()();
+//~^ ERROR function pointer
+
+const fn call_ptr() {
+    make_fn_ptr()();
+    //~^ ERROR function pointer
+}
+
+fn main() {}