2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2014-01-03 23:30:54 +00:00
|
|
|
pub fn main() {
|
2015-02-15 08:52:21 +00:00
|
|
|
match &[(Box::new(5),Box::new(7))] {
|
2013-08-13 22:57:37 +00:00
|
|
|
ps => {
|
|
|
|
let (ref y, _) = ps[0];
|
2015-06-07 18:00:38 +00:00
|
|
|
assert_eq!(**y, 5);
|
2013-08-13 22:57:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-15 08:52:21 +00:00
|
|
|
match Some(&[(Box::new(5),)]) {
|
2013-08-13 22:57:37 +00:00
|
|
|
Some(ps) => {
|
|
|
|
let (ref y,) = ps[0];
|
2015-06-07 18:00:38 +00:00
|
|
|
assert_eq!(**y, 5);
|
2013-08-13 22:57:37 +00:00
|
|
|
}
|
|
|
|
None => ()
|
|
|
|
}
|
|
|
|
|
2015-02-15 08:52:21 +00:00
|
|
|
match Some(&[(Box::new(5),Box::new(7))]) {
|
2013-08-13 22:57:37 +00:00
|
|
|
Some(ps) => {
|
|
|
|
let (ref y, ref z) = ps[0];
|
2015-06-07 18:00:38 +00:00
|
|
|
assert_eq!(**y, 5);
|
|
|
|
assert_eq!(**z, 7);
|
2013-08-13 22:57:37 +00:00
|
|
|
}
|
|
|
|
None => ()
|
|
|
|
}
|
|
|
|
}
|