]> git.lizzy.rs Git - rust.git/commitdiff
Fix tests
authorAlex Crichton <alex@alexcrichton.com>
Thu, 11 Jul 2013 08:03:37 +0000 (01:03 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 12 Jul 2013 01:57:19 +0000 (18:57 -0700)
src/librusti/program.rs
src/libstd/local_data.rs
src/test/compile-fail/core-tls-store-pointer.rs

index 03a48117cd4e5b6c15d6351fd1e7292e112ba043..716c7a2481eed13e27646ab41c863e7b7e5699a9 100644 (file)
@@ -58,7 +58,7 @@ struct LocalVariable {
 }
 
 type LocalCache = @mut HashMap<~str, @~[u8]>;
-fn tls_key(_k: @LocalCache) {}
+fn tls_key(_k: LocalCache) {}
 
 impl Program {
     pub fn new() -> Program {
@@ -132,7 +132,7 @@ fn main() {
         ");
 
         let key: sys::Closure = unsafe {
-            let tls_key: &'static fn(@LocalCache) = tls_key;
+            let tls_key: &'static fn(LocalCache) = tls_key;
             cast::transmute(tls_key)
         };
         // First, get a handle to the tls map which stores all the local
@@ -144,7 +144,7 @@ fn main() {
                 let key = ::std::sys::Closure{ code: %? as *(),
                                                env: ::std::ptr::null() };
                 let key = ::std::cast::transmute(key);
-                *::std::local_data::get(key, |k| k.map(|&x| *x)).unwrap()
+                ::std::local_data::get(key, |k| k.map(|&x| *x)).unwrap()
             };\n", key.code as uint));
 
         // Using this __tls_map handle, deserialize each variable binding that
@@ -227,7 +227,7 @@ pub fn set_cache(&self) {
             map.insert(copy *name, @copy value.data);
         }
         unsafe {
-            local_data::set(tls_key, @map);
+            local_data::set(tls_key, map);
         }
     }
 
index fa981d273e28ccc15ea03cac023a9d570f76251e..b241de887004c15d8f1125a3532cfde6c2e8f60c 100644 (file)
@@ -170,7 +170,7 @@ fn test_tls_pop() {
     unsafe {
         fn my_key(_x: @~str) { }
         set(my_key, @~"weasel");
-        assert!(*(pop(my_key, |k| k.map(|&k| *k)).get()) == ~"weasel");
+        assert!(*(pop(my_key).get()) == ~"weasel");
         // Pop must remove the data from the map.
         assert!(pop(my_key).is_none());
     }
index 63bbaf80177e1b515dbb5134e5a8175997648566..13c996692288955091dabfc130bdf4e809d219d2 100644 (file)
 
 // Testing that we can't store a borrowed pointer it task-local storage
 
-use std::local_data::*;
+use std::local_data;
 
 fn key(_x: @&int) { }
 
 fn main() {
     unsafe {
-        local_data_set(key, @&0); //~ ERROR does not fulfill `'static`
+        local_data::set(key, @&0); //~ ERROR does not fulfill `'static`
     }
 }