about summary refs log tree commit diff
path: root/tests/ui/pattern/array-length-mismatch-13482.rs
blob: 78d024e522727325fdbb9930d2b0daf7337838d1 (plain)
1
2
3
4
5
6
7
8
9
//! Regression test for https://github.com/rust-lang/rust/issues/13482

fn main() {
  let x = [1,2];
  let y = match x {
    [] => None, //~ ERROR pattern requires 0 elements but array has 2
    [a,_] => Some(a)
  };
}