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