about summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-09-17 10:47:05 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-09-21 21:05:05 -0700
commit81d1feb9804f66034df4f218cc8fb0209c7450a7 (patch)
tree0c524deb8ce5015102af2d2f7a0df93d0fd2f5f7 /src/libstd/collections
parent72841b128df8b6a4eb88b1048548e2eec5244449 (diff)
downloadrust-81d1feb9804f66034df4f218cc8fb0209c7450a7.tar.gz
rust-81d1feb9804f66034df4f218cc8fb0209c7450a7.zip
Remove #[allow(deprecated)] from libstd
Diffstat (limited to 'src/libstd/collections')
-rw-r--r--src/libstd/collections/hashmap/map.rs3
-rw-r--r--src/libstd/collections/hashmap/table.rs4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/collections/hashmap/map.rs b/src/libstd/collections/hashmap/map.rs
index e8c5eecc6f2..b0604e13163 100644
--- a/src/libstd/collections/hashmap/map.rs
+++ b/src/libstd/collections/hashmap/map.rs
@@ -1288,7 +1288,7 @@ impl<K: Eq + Hash<S>, V: Clone, S, H: Hasher<S>> HashMap<K, V, H> {
     /// let s: String = map.get_copy(&1);
     /// ```
     pub fn get_copy(&self, k: &K) -> V {
-        (*self.get(k)).clone()
+        self[*k].clone()
     }
 }
 
@@ -1325,6 +1325,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> Default for HashMap<K, V, H>
 
 impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> Index<K, V> for HashMap<K, V, H> {
     #[inline]
+    #[allow(deprecated)]
     fn index<'a>(&'a self, index: &K) -> &'a V {
         self.get(index)
     }
diff --git a/src/libstd/collections/hashmap/table.rs b/src/libstd/collections/hashmap/table.rs
index 87a5cc1484a..45ca633b41f 100644
--- a/src/libstd/collections/hashmap/table.rs
+++ b/src/libstd/collections/hashmap/table.rs
@@ -846,8 +846,8 @@ impl<K: Clone, V: Clone> Clone for RawTable<K, V> {
                                 (full.hash(), k.clone(), v.clone())
                             };
                             *new_buckets.raw.hash = h.inspect();
-                            mem::overwrite(new_buckets.raw.key, k);
-                            mem::overwrite(new_buckets.raw.val, v);
+                            ptr::write(new_buckets.raw.key, k);
+                            ptr::write(new_buckets.raw.val, v);
                         }
                         Empty(..) => {
                             *new_buckets.raw.hash = EMPTY_BUCKET;