parent
c492a2126f
commit
5209709e46
3 changed files with 38 additions and 1 deletions
12
src/test/run-pass/match-vec-rvalue.rs
Normal file
12
src/test/run-pass/match-vec-rvalue.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue