]> git.proxmox.com Git - rustc.git/blob - src/test/ui/match/issue-42679.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / match / issue-42679.rs
1 // run-pass
2 #![feature(box_patterns)]
3
4 #[derive(Debug, PartialEq)]
5 enum Test {
6 Foo(usize),
7 Bar(isize),
8 }
9
10 fn main() {
11 let a = Box::new(Test::Foo(10));
12 let b = Box::new(Test::Bar(-20));
13 match (a, b) {
14 (_, box Test::Foo(_)) => unreachable!(),
15 (box Test::Foo(x), b) => {
16 assert_eq!(x, 10);
17 assert_eq!(b, Box::new(Test::Bar(-20)));
18 },
19 _ => unreachable!(),
20 }
21 }