Skip to content

Commit fd49f6d

Browse files
committed
auto merge of #9073 : alexcrichton/rust/remove-local-data-hax, r=huonw
These compiler bugs have since been fixed (one less layer of indirection)
2 parents d09f569 + 500077f commit fd49f6d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/libstd/local_data.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ pub fn pop<T: 'static>(key: Key<T>) -> Option<T> {
155155

156156
// Move `data` into transmute to get out the memory that it
157157
// owns, we must free it manually later.
158-
let (_vtable, box): (uint, ~~T) = unsafe {
158+
let (_vtable, box): (uint, ~T) = unsafe {
159159
cast::transmute(data)
160160
};
161161

162162
// Now that we own `box`, we can just move out of it as we would
163163
// with any other data.
164-
return Some(**box);
164+
return Some(*box);
165165
}
166166
_ => {}
167167
}
@@ -244,13 +244,13 @@ fn get_with<T: 'static, U>(key: Key<T>,
244244
want.describe(), cur.describe());
245245
}
246246
}
247-
// data was created with `~~T as ~LocalData`, so we extract
248-
// pointer part of the trait, (as ~~T), and then use
247+
// data was created with `~T as ~LocalData`, so we extract
248+
// pointer part of the trait, (as ~T), and then use
249249
// compiler coercions to achieve a '&' pointer.
250250
unsafe {
251-
match *cast::transmute::<&TLSValue, &(uint, ~~T)>(data){
251+
match *cast::transmute::<&TLSValue, &(uint, ~T)>(data){
252252
(_vtable, ref box) => {
253-
let value: &T = **box;
253+
let value: &T = *box;
254254
ret = f(Some(value));
255255
}
256256
}
@@ -294,9 +294,7 @@ pub fn set<T: 'static>(key: Key<T>, data: T) {
294294
// everything to a trait (LocalData) which is then stored inside the map.
295295
// Upon destruction of the map, all the objects will be destroyed and the
296296
// traits have enough information about them to destroy themselves.
297-
//
298-
// FIXME(#7673): This should be "~data as ~LocalData" (only one sigil)
299-
let data = ~~data as ~LocalData:;
297+
let data = ~data as ~LocalData:;
300298

301299
fn insertion_position(map: &mut Map,
302300
key: *libc::c_void) -> Option<uint> {

0 commit comments

Comments
 (0)