diff options
| author | bors <bors@rust-lang.org> | 2013-07-26 19:46:36 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-26 19:46:36 -0700 |
| commit | 4989799799df1fb7c23fc0bf017be8faa356387f (patch) | |
| tree | 31cdd51e5e11c9d131d5a74ce8cd05c76c796e70 /src/libstd/task | |
| parent | 5c4cd30f80273ba573df048b6295ea6e543df599 (diff) | |
| parent | 5aaaca0c6a837ef60260b07121f4b4c4984afc70 (diff) | |
| download | rust-4989799799df1fb7c23fc0bf017be8faa356387f.tar.gz rust-4989799799df1fb7c23fc0bf017be8faa356387f.zip | |
auto merge of #7986 : alexcrichton/rust/raw-repr, r=brson
This moves the raw struct layout of closures, vectors, boxes, and strings into a new `unstable::raw` module. This is meant to be a centralized location to find information for the layout of these values. As safe method, `unwrap`, is provided to convert a rust value to its raw representation. Unsafe methods to convert back are not provided because they are rarely used and too numerous to write an implementation for each (not much of a common pattern). This is progress on #6790. I tried to get a nice interface for a trait to implement in the raw module, but I was unable to come up with one. The hard part is that there are so many different directions to go from one way to another that it's difficult to find a pattern to follow to implement a trait with. Someone else might have some better luck though.
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/local_data_priv.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/task/local_data_priv.rs b/src/libstd/task/local_data_priv.rs index d5f4973e8c7..477981c65e5 100644 --- a/src/libstd/task/local_data_priv.rs +++ b/src/libstd/task/local_data_priv.rs @@ -15,8 +15,8 @@ use libc; use local_data; use prelude::*; use ptr; -use sys; use task::rt; +use unstable::raw; use util; use super::rt::rust_task; @@ -158,7 +158,7 @@ unsafe fn get_local_map(handle: Handle) -> &mut TaskLocalMap { } unsafe fn key_to_key_value<T: 'static>(key: local_data::Key<T>) -> *libc::c_void { - let pair: sys::Closure = cast::transmute_copy(&key); + let pair: raw::Closure = cast::transmute_copy(&key); return pair.code as *libc::c_void; } |
