Skip to content

Commit 0f814e3

Browse files
committed
add test for #116796
1 parent edcbcc7 commit 0f814e3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// https://github.com/rust-lang/rust/issues/116796
2+
3+
struct X<const FN: fn() = { || {} }>;
4+
//~^ ERROR using function pointers as const generic parameters is forbidden
5+
6+
fn main() {}
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/default-ty-closure.rs:3: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)