Skip to content

Commit

Permalink
add test for rust-lang#116796
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanjoi committed Dec 23, 2023
1 parent edcbcc7 commit 5a40b6b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/ui/consts/issue-116796.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
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/consts/issue-116796.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/issue-116796.rs:1:20
|
LL | struct X<const FN: fn() = { || {} }>;
| ^^^^
|
= note: the only supported types are integers, `bool` and `char`

error: aborting due to 1 previous error

0 comments on commit 5a40b6b

Please sign in to comment.