about summary refs log tree commit diff
path: root/src/libstd/sys.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-07-21 17:20:52 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-07-26 09:53:03 -0700
commit5aaaca0c6a837ef60260b07121f4b4c4984afc70 (patch)
tree69fd81f9f8669b681f5cb8d7382485045b96539d /src/libstd/sys.rs
parent7fd23e4fe26bc9d6eef9596593ba3ddbe83f4a10 (diff)
downloadrust-5aaaca0c6a837ef60260b07121f4b4c4984afc70.tar.gz
rust-5aaaca0c6a837ef60260b07121f4b4c4984afc70.zip
Consolidate raw representations of rust values
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, `repr`, 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).
Diffstat (limited to 'src/libstd/sys.rs')
-rw-r--r--src/libstd/sys.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libstd/sys.rs b/src/libstd/sys.rs
index 28cd2345aab..5cf77d901db 100644
--- a/src/libstd/sys.rs
+++ b/src/libstd/sys.rs
@@ -22,12 +22,6 @@ use str::StrSlice;
 use str;
 use unstable::intrinsics;
 
-/// The representation of a Rust closure
-pub struct Closure {
-    code: *(),
-    env: *(),
-}
-
 pub mod rustrt {
     use libc::{c_char, size_t};
 
@@ -278,6 +272,7 @@ mod tests {
 
     #[test]
     fn synthesize_closure() {
+        use unstable::raw::Closure;
         unsafe {
             let x = 10;
             let f: &fn(int) -> int = |y| x + y;