Fix matching of rvalues with destructors

Fixes #4542.
This commit is contained in:
Niko Matsakis 2013-05-29 18:33:30 -04:00
parent c492a2126f
commit 5209709e46
3 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,12 @@
// Tests that matching rvalues with drops does not crash.
fn main() {
match ~[1, 2, 3] {
x => {
assert_eq!(x.len(), 3);
assert_eq!(x[0], 1);
assert_eq!(x[1], 2);
assert_eq!(x[2], 3);
}
}
}