We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88fe556 commit 99884bdCopy full SHA for 99884bd
src/test/ui/const-generics/issues/issue-71382.rs
@@ -0,0 +1,24 @@
1
+#![feature(const_generics)]
2
+#![allow(incomplete_features)]
3
+
4
+struct Test();
5
6
+fn pass() {
7
+ println!("Hello, world!");
8
+}
9
10
+impl Test {
11
+ pub fn call_me(&self) {
12
+ self.test::<pass>();
13
+ }
14
15
+ fn test<const FN: fn()>(&self) {
16
+ //~^ ERROR: using function pointers as const generic parameters is forbidden
17
+ FN();
18
19
20
21
+fn main() {
22
+ let x = Test();
23
+ x.call_me()
24
src/test/ui/const-generics/issues/issue-71382.stderr
@@ -0,0 +1,8 @@
+error: using function pointers as const generic parameters is forbidden
+ --> $DIR/issue-71382.rs:15:23
+ |
+LL | fn test<const FN: fn()>(&self) {
+ | ^^^^
+error: aborting due to previous error
0 commit comments