Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/ui/const-generics/default-ty-closure.rs
Original file line number Diff line number Diff line change
@@ -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() {}
10 changes: 10 additions & 0 deletions tests/ui/const-generics/default-ty-closure.stderr
Original file line number Diff line number Diff line change
@@ -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