2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2013-05-29 18:33:30 -04:00
|
|
|
// Tests that matching rvalues with drops does not crash.
|
|
|
|
|
|
2014-03-05 15:28:08 -08:00
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-09-25 00:43:37 -07:00
|
|
|
pub fn main() {
|
2016-10-29 22:54:04 +01:00
|
|
|
match vec![1, 2, 3] {
|
2013-05-29 18:33:30 -04:00
|
|
|
x => {
|
|
|
|
|
assert_eq!(x.len(), 3);
|
2014-10-14 23:05:01 -07:00
|
|
|
assert_eq!(x[0], 1);
|
|
|
|
|
assert_eq!(x[1], 2);
|
|
|
|
|
assert_eq!(x[2], 3);
|
2013-05-29 18:33:30 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|