about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-10-25 13:28:17 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-10-25 13:28:17 -0400
commit3942ab92f08db0f62aabdb1fb9a9f05ad34cc56d (patch)
tree1bc1a3e407cdd2fc52cb5ccdaa5da0b2141bfaa2
parent80e5fe1a56bb95e8e89d5f8f0ff5122583bb5336 (diff)
downloadrust-3942ab92f08db0f62aabdb1fb9a9f05ad34cc56d.tar.gz
rust-3942ab92f08db0f62aabdb1fb9a9f05ad34cc56d.zip
make the core::raw struct representation defined
Closes #18313
-rw-r--r--src/libcore/raw.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs
index a62e2ecdca0..fe365b43ca6 100644
--- a/src/libcore/raw.rs
+++ b/src/libcore/raw.rs
@@ -21,18 +21,21 @@
 use mem;
 
 /// The representation of a Rust slice
+#[repr(C)]
 pub struct Slice<T> {
     pub data: *const T,
     pub len: uint,
 }
 
 /// The representation of a Rust closure
+#[repr(C)]
 pub struct Closure {
     pub code: *mut (),
     pub env: *mut (),
 }
 
 /// The representation of a Rust procedure (`proc()`)
+#[repr(C)]
 pub struct Procedure {
     pub code: *mut (),
     pub env: *mut (),
@@ -42,6 +45,7 @@ pub struct Procedure {
 ///
 /// This struct does not have a `Repr` implementation
 /// because there is no way to refer to all trait objects generically.
+#[repr(C)]
 pub struct TraitObject {
     pub data: *mut (),
     pub vtable: *mut (),
@@ -60,4 +64,3 @@ pub trait Repr<T> {
 
 impl<'a, T> Repr<Slice<T>> for &'a [T] {}
 impl<'a> Repr<Slice<u8>> for &'a str {}
-