diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-05-08 23:40:15 +0200 |
---|---|---|
committer | Jack Moffitt <jack@metajack.im> | 2014-05-22 16:36:40 -0600 |
commit | eaedeb07cb0c4fdda37f35057588e4a769fbe758 (patch) | |
tree | cdeb134482f06818f7d6dbad8e008882fcc336a5 /src/components/util/concurrentmap.rs | |
parent | 3644d0272c89336954358eb5005f884a9c89e8bc (diff) | |
download | servo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.tar.gz servo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.zip |
Update Rust.
Diffstat (limited to 'src/components/util/concurrentmap.rs')
-rw-r--r-- | src/components/util/concurrentmap.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/util/concurrentmap.rs b/src/components/util/concurrentmap.rs index 1a2fbd404cf..47a83b2da8a 100644 --- a/src/components/util/concurrentmap.rs +++ b/src/components/util/concurrentmap.rs @@ -23,7 +23,7 @@ static LOAD_DENOMINATOR: uint = 4; /// One bucket in the hash table. struct Bucket<K,V> { - next: Option<~Bucket<K,V>>, + next: Option<Box<Bucket<K,V>>>, key: K, value: V, } @@ -116,7 +116,7 @@ impl<K:Hash + Eq,V> ConcurrentHashMap<K,V> { } } - (*bucket).next = Some(~Bucket { + (*bucket).next = Some(box Bucket { next: None, key: key, value: value, @@ -153,7 +153,7 @@ impl<K:Hash + Eq,V> ConcurrentHashMap<K,V> { let next_opt = mem::replace(&mut bucket.next, None); match next_opt { None => nuke_bucket = true, - Some(~next) => *bucket = next, + Some(box next) => *bucket = next, } drop(this.size.fetch_sub(1, SeqCst)) } @@ -175,7 +175,7 @@ impl<K:Hash + Eq,V> ConcurrentHashMap<K,V> { } // If we got here, then we found the key. Now do a pointer stitch. - let ~Bucket { + let box Bucket { next: next_next, .. } = (*prev).next.take_unwrap(); @@ -314,7 +314,7 @@ impl<K:Hash + Eq,V> ConcurrentHashMap<K,V> { loop { match bucket { None => break, - Some(~Bucket { + Some(box Bucket { key: key, value: value, next: next @@ -346,7 +346,7 @@ impl<K:Hash + Eq,V> ConcurrentHashMap<K,V> { #[inline] fn bucket_and_lock_indices(&self, key: &K) -> (uint, uint) { let this: &mut ConcurrentHashMap<K,V> = unsafe { - cast::transmute_mut(cast::transmute_region(self)) + cast::transmute_mut(cast::transmute_lifetime(self)) }; let hash = sip::hash_with_keys(self.k0, self.k1, key); |