Skip to content

Commit 5a40b6b

Browse files
committed
add test for #116796
1 parent edcbcc7 commit 5a40b6b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/ui/consts/issue-116796.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
struct X<const FN: fn() = { || {} }>;
2+
//~^ ERROR using function pointers as const generic parameters is forbidden
3+
fn main() {}

tests/ui/consts/issue-116796.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: using function pointers as const generic parameters is forbidden
2+
--> $DIR/issue-116796.rs:1:20
3+
|
4+
LL | struct X<const FN: fn() = { || {} }>;
5+
| ^^^^
6+
|
7+
= note: the only supported types are integers, `bool` and `char`
8+
9+
error: aborting due to 1 previous error
10+

0 commit comments

Comments
 (0)