2025-07-24 17:52:22 +05:00
|
|
|
//! Regression test for https://github.com/rust-lang/rust/issues/13482
|
|
|
|
|
|
2014-06-01 14:40:55 +02:00
|
|
|
fn main() {
|
|
|
|
|
let x = [1,2];
|
|
|
|
|
let y = match x {
|
2016-03-11 12:54:59 +02:00
|
|
|
[] => None, //~ ERROR pattern requires 0 elements but array has 2
|
2014-06-01 14:40:55 +02:00
|
|
|
[a,_] => Some(a)
|
|
|
|
|
};
|
|
|
|
|
}
|