diff --git a/tests/ui/const-generics/default-ty-closure.rs b/tests/ui/const-generics/default-ty-closure.rs new file mode 100644 index 0000000000000..36128505dda35 --- /dev/null +++ b/tests/ui/const-generics/default-ty-closure.rs @@ -0,0 +1,6 @@ +// https://github.com/rust-lang/rust/issues/116796 + +struct X; +//~^ ERROR using function pointers as const generic parameters is forbidden + +fn main() {} diff --git a/tests/ui/const-generics/default-ty-closure.stderr b/tests/ui/const-generics/default-ty-closure.stderr new file mode 100644 index 0000000000000..9c737c1a19def --- /dev/null +++ b/tests/ui/const-generics/default-ty-closure.stderr @@ -0,0 +1,10 @@ +error: using function pointers as const generic parameters is forbidden + --> $DIR/default-ty-closure.rs:3:20 + | +LL | struct X; + | ^^^^ + | + = note: the only supported types are integers, `bool` and `char` + +error: aborting due to 1 previous error +