]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/issue-7660.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / issue-7660.rs
index 7f1382cf89099b381b9c261c70c5fd798f4eeb1d..8a953cea9048dd02463c64e8586f75e696e3038b 100644 (file)
@@ -11,7 +11,9 @@
 // Regresion test for issue 7660
 // rvalue lifetime too short when equivalent `match` works
 
-use std::hashmap::HashMap;
+extern crate collections;
+
+use std::collections::HashMap;
 
 struct A(int, int);
 
@@ -19,6 +21,6 @@ pub fn main() {
     let mut m: HashMap<int, A> = HashMap::new();
     m.insert(1, A(0, 0));
 
-    let A(ref _a, ref _b) = *m.get(&1);
-    let (a, b) = match *m.get(&1) { A(ref _a, ref _b) => (_a, _b) };
+    let A(ref _a, ref _b) = m[1];
+    let (a, b) = match m[1] { A(ref _a, ref _b) => (_a, _b) };
 }