diff options
| author | bors <bors@rust-lang.org> | 2014-08-01 18:36:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-01 18:36:01 +0000 |
| commit | 6136381ed86189a027e641d233a1296ff8b60679 (patch) | |
| tree | 62c2fa624ade926745630ae94cb12247cbb53da7 /src/libstd | |
| parent | f2fa55903e378368ed9173560f03a0ef16e371c2 (diff) | |
| parent | 5d4d09daf2e8e46839647d4e72b1cbefebad6ece (diff) | |
| download | rust-6136381ed86189a027e641d233a1296ff8b60679.tar.gz rust-6136381ed86189a027e641d233a1296ff8b60679.zip | |
auto merge of #16102 : zwarich/rust/borrowck-unboxed, r=pcwalton
This removes the ability of the borrow checker to determine that repeated dereferences of a Box<T> refer to the same memory object.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/lru_cache.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/collections/lru_cache.rs b/src/libstd/collections/lru_cache.rs index 45e971a675f..32a16053fff 100644 --- a/src/libstd/collections/lru_cache.rs +++ b/src/libstd/collections/lru_cache.rs @@ -331,7 +331,8 @@ impl<K, V> Drop for LruCache<K, V> { unsafe { let node: Box<LruEntry<K, V>> = mem::transmute(self.head); // Prevent compiler from trying to drop the un-initialized field in the sigil node. - let box LruEntry { key: k, value: v, .. } = node; + let box internal_node = node; + let LruEntry { next: _, prev: _, key: k, value: v } = internal_node; mem::forget(k); mem::forget(v); } |
