about summary refs log tree commit diff
path: root/tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs')
-rw-r--r--tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs b/tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs
new file mode 100644
index 00000000000..5b0482de220
--- /dev/null
+++ b/tests/ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+// This used to cause a stack overflow during exhaustiveness checking in the compiler.
+
+fn main() {
+    const LARGE_SIZE: usize = 1024 * 1024;
+    let [..] = [0u8; LARGE_SIZE];
+    match [0u8; LARGE_SIZE] {
+        [..] => {}
+    }
+}