]> git.lizzy.rs Git - rust.git/commitdiff
make the core::raw struct representation defined
authorDaniel Micay <danielmicay@gmail.com>
Sat, 25 Oct 2014 17:28:17 +0000 (13:28 -0400)
committerDaniel Micay <danielmicay@gmail.com>
Sat, 25 Oct 2014 17:28:17 +0000 (13:28 -0400)
Closes #18313

src/libcore/raw.rs

index a62e2ecdca0328d9e22b392b7dd7904acbdb986d..fe365b43ca6d1838e860f0254e2de10ce92b0c1b 100644 (file)
 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 @@ fn repr(&self) -> T { unsafe { mem::transmute_copy(self) } }
 
 impl<'a, T> Repr<Slice<T>> for &'a [T] {}
 impl<'a> Repr<Slice<u8>> for &'a str {}
-