about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-09-09 01:01:23 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-09-09 01:01:23 -0700
commit500077f637114be0ac9e6ef5fb92933c4c97804d (patch)
tree5a924afa06957cf02554b76bc4a5be512dac2b58
parent5591dce52eb35730e89070c7e104e1f1bf0a8ab3 (diff)
downloadrust-500077f637114be0ac9e6ef5fb92933c4c97804d.tar.gz
rust-500077f637114be0ac9e6ef5fb92933c4c97804d.zip
Remove hacks around issues in local_data
These compiler bugs have since been fixed (one less layer of indirection)
-rw-r--r--src/libstd/local_data.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs
index 88e7dd692fe..a13c75635dc 100644
--- a/src/libstd/local_data.rs
+++ b/src/libstd/local_data.rs
@@ -155,13 +155,13 @@ pub fn pop<T: 'static>(key: Key<T>) -> Option<T> {
 
                 // Move `data` into transmute to get out the memory that it
                 // owns, we must free it manually later.
-                let (_vtable, box): (uint, ~~T) = unsafe {
+                let (_vtable, box): (uint, ~T) = unsafe {
                     cast::transmute(data)
                 };
 
                 // Now that we own `box`, we can just move out of it as we would
                 // with any other data.
-                return Some(**box);
+                return Some(*box);
             }
             _ => {}
         }
@@ -244,13 +244,13 @@ fn get_with<T: 'static, U>(key: Key<T>,
                                   want.describe(), cur.describe());
                         }
                     }
-                    // data was created with `~~T as ~LocalData`, so we extract
-                    // pointer part of the trait, (as ~~T), and then use
+                    // data was created with `~T as ~LocalData`, so we extract
+                    // pointer part of the trait, (as ~T), and then use
                     // compiler coercions to achieve a '&' pointer.
                     unsafe {
-                        match *cast::transmute::<&TLSValue, &(uint, ~~T)>(data){
+                        match *cast::transmute::<&TLSValue, &(uint, ~T)>(data){
                             (_vtable, ref box) => {
-                                let value: &T = **box;
+                                let value: &T = *box;
                                 ret = f(Some(value));
                             }
                         }
@@ -294,9 +294,7 @@ pub fn set<T: 'static>(key: Key<T>, data: T) {
     // everything to a trait (LocalData) which is then stored inside the map.
     // Upon destruction of the map, all the objects will be destroyed and the
     // traits have enough information about them to destroy themselves.
-    //
-    // FIXME(#7673): This should be "~data as ~LocalData" (only one sigil)
-    let data = ~~data as ~LocalData:;
+    let data = ~data as ~LocalData:;
 
     fn insertion_position(map: &mut Map,
                           key: *libc::c_void) -> Option<uint> {