Skip to content

Commit 08cc634

Browse files
committed
Auto merge of #117176 - bvanjoi:fix-116796, r=jackh726
mark ty::Const::Error when meet unsupport ty for const generic params Close #116796
2 parents cf64273 + 0f814e3 commit 08cc634

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)