]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-8498.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-8498.rs
1 // run-pass
2
3 pub fn main() {
4 match &[(Box::new(5),Box::new(7))] {
5 ps => {
6 let (ref y, _) = ps[0];
7 assert_eq!(**y, 5);
8 }
9 }
10
11 match Some(&[(Box::new(5),)]) {
12 Some(ps) => {
13 let (ref y,) = ps[0];
14 assert_eq!(**y, 5);
15 }
16 None => ()
17 }
18
19 match Some(&[(Box::new(5),Box::new(7))]) {
20 Some(ps) => {
21 let (ref y, ref z) = ps[0];
22 assert_eq!(**y, 5);
23 assert_eq!(**z, 7);
24 }
25 None => ()
26 }
27 }