slice matching overflow got fixed

This commit is contained in:
Ralf Jung 2019-11-20 19:38:41 +01:00
parent 11603c4657
commit f16f891191
2 changed files with 3 additions and 6 deletions

View File

@ -1 +1 @@
3e525e3f6d9e85d54fa4c49b52df85aa0c990100
b9cf5417892ef242c783ef963deff5436205b0f6

View File

@ -1,14 +1,11 @@
//ignore-windows: Causes a stack overflow?!? Likely a rustc bug: https://github.com/rust-lang/rust/issues/53820
//FIXME: Once that bug is fixed, increase the size to 16*1024 and enable on all platforms.
#![feature(slice_patterns)]
fn main() {
assert_eq!(match [0u8; 1024] {
assert_eq!(match [0u8; 16*1024] {
_ => 42_usize,
}, 42_usize);
assert_eq!(match [0u8; 1024] {
assert_eq!(match [0u8; 16*1024] {
[1, ..] => 0_usize,
[0, ..] => 1_usize,
_ => 2_usize