]> git.lizzy.rs Git - rust.git/blob - src/test/ui/match/issue-42679.rs
Rollup merge of #93542 - GuillaumeGomez:lifetime-elision, r=oli-obk
[rust.git] / src / test / ui / match / issue-42679.rs
1 // run-pass
2 #![feature(box_syntax)]
3 #![feature(box_patterns)]
4
5 #[derive(Debug, PartialEq)]
6 enum Test {
7     Foo(usize),
8     Bar(isize),
9 }
10
11 fn main() {
12     let a = box Test::Foo(10);
13     let b = box Test::Bar(-20);
14     match (a, b) {
15         (_, box Test::Foo(_)) => unreachable!(),
16         (box Test::Foo(x), b) => {
17             assert_eq!(x, 10);
18             assert_eq!(b, box Test::Bar(-20));
19         },
20         _ => unreachable!(),
21     }
22 }