summaryrefslogtreecommitdiffstats
path: root/src/test/ui/binding/const-param.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/binding/const-param.rs')
-rw-r--r--src/test/ui/binding/const-param.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/binding/const-param.rs b/src/test/ui/binding/const-param.rs
new file mode 100644
index 000000000..2d051808f
--- /dev/null
+++ b/src/test/ui/binding/const-param.rs
@@ -0,0 +1,10 @@
+// Identifier pattern referring to a const generic parameter is an error (issue #68853).
+
+fn check<const N: usize>() {
+ match 1 {
+ N => {} //~ ERROR const parameters cannot be referenced in patterns
+ _ => {}
+ }
+}
+
+fn main() {}