Skip to content

Commit a15c1b4

Browse files
committed
Fix tests
1 parent f9bf69d commit a15c1b4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librusti/program.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct LocalVariable {
5858
}
5959

6060
type LocalCache = @mut HashMap<~str, @~[u8]>;
61-
fn tls_key(_k: @LocalCache) {}
61+
fn tls_key(_k: LocalCache) {}
6262

6363
impl Program {
6464
pub fn new() -> Program {
@@ -132,7 +132,7 @@ impl Program {
132132
");
133133

134134
let key: sys::Closure = unsafe {
135-
let tls_key: &'static fn(@LocalCache) = tls_key;
135+
let tls_key: &'static fn(LocalCache) = tls_key;
136136
cast::transmute(tls_key)
137137
};
138138
// First, get a handle to the tls map which stores all the local
@@ -144,7 +144,7 @@ impl Program {
144144
let key = ::std::sys::Closure{ code: %? as *(),
145145
env: ::std::ptr::null() };
146146
let key = ::std::cast::transmute(key);
147-
*::std::local_data::get(key, |k| k.map(|&x| *x)).unwrap()
147+
::std::local_data::get(key, |k| k.map(|&x| *x)).unwrap()
148148
};\n", key.code as uint));
149149

150150
// Using this __tls_map handle, deserialize each variable binding that
@@ -227,7 +227,7 @@ impl Program {
227227
map.insert(copy *name, @copy value.data);
228228
}
229229
unsafe {
230-
local_data::set(tls_key, @map);
230+
local_data::set(tls_key, map);
231231
}
232232
}
233233

src/libstd/local_data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn test_tls_pop() {
170170
unsafe {
171171
fn my_key(_x: @~str) { }
172172
set(my_key, @~"weasel");
173-
assert!(*(pop(my_key, |k| k.map(|&k| *k)).get()) == ~"weasel");
173+
assert!(*(pop(my_key).get()) == ~"weasel");
174174
// Pop must remove the data from the map.
175175
assert!(pop(my_key).is_none());
176176
}

src/test/compile-fail/core-tls-store-pointer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
// Testing that we can't store a borrowed pointer it task-local storage
1212

13-
use std::local_data::*;
13+
use std::local_data;
1414

1515
fn key(_x: @&int) { }
1616

1717
fn main() {
1818
unsafe {
19-
local_data_set(key, @&0); //~ ERROR does not fulfill `'static`
19+
local_data::set(key, @&0); //~ ERROR does not fulfill `'static`
2020
}
2121
}

0 commit comments

Comments
 (0)