about summary refs log tree commit diff
path: root/tests/ui/const-generics/issues/issue-71382.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/issues/issue-71382.rs')
-rw-r--r--tests/ui/const-generics/issues/issue-71382.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/const-generics/issues/issue-71382.rs b/tests/ui/const-generics/issues/issue-71382.rs
new file mode 100644
index 00000000000..4392d72e566
--- /dev/null
+++ b/tests/ui/const-generics/issues/issue-71382.rs
@@ -0,0 +1,25 @@
+// revisions: full min
+#![cfg_attr(full, feature(adt_const_params))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+struct Test();
+
+fn pass() {
+    println!("Hello, world!");
+}
+
+impl Test {
+    pub fn call_me(&self) {
+        self.test::<pass>();
+    }
+
+    fn test<const FN: fn()>(&self) {
+        //~^ ERROR: using function pointers as const generic parameters is forbidden
+        FN();
+    }
+}
+
+fn main() {
+    let x = Test();
+    x.call_me()
+}