mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
add test for #116796
This commit is contained in:
parent
edcbcc768a
commit
0f814e3899
6
tests/ui/const-generics/default-ty-closure.rs
Normal file
6
tests/ui/const-generics/default-ty-closure.rs
Normal 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() {}
|
10
tests/ui/const-generics/default-ty-closure.stderr
Normal file
10
tests/ui/const-generics/default-ty-closure.stderr
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user