This commit is contained in:
bohan 2023-12-24 01:45:02 +08:00
parent edcbcc768a
commit 0f814e3899
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,6 @@
// https://github.com/rust-lang/rust/issues/116796
struct X<const FN: fn() = { || {} }>;
//~^ ERROR using function pointers as const generic parameters is forbidden
fn main() {}

View File

@ -0,0 +1,10 @@
error: using function pointers as const generic parameters is forbidden
--> $DIR/default-ty-closure.rs:3:20
|
LL | struct X<const FN: fn() = { || {} }>;
| ^^^^
|
= note: the only supported types are integers, `bool` and `char`
error: aborting due to 1 previous error