rust/tests/ui/match/match-tuple-slice.rs
2026-01-22 19:50:00 +01:00

12 lines
292 B
Rust

//! regression test for <https://github.com/rust-lang/rust/issues/16648>
//@ run-pass
fn main() {
let x: (isize, &[isize]) = (2, &[1, 2]);
assert_eq!(match x {
(0, &[_, _]) => 0,
(1, _) => 1,
(2, &[_, _]) => 2,
(2, _) => 3,
_ => 4
}, 2);
}