File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 21
21
use mem;
22
22
23
23
/// The representation of a Rust slice
24
+ #[ repr( C ) ]
24
25
pub struct Slice < T > {
25
26
pub data : * const T ,
26
27
pub len : uint ,
27
28
}
28
29
29
30
/// The representation of a Rust closure
31
+ #[ repr( C ) ]
30
32
pub struct Closure {
31
33
pub code : * mut ( ) ,
32
34
pub env : * mut ( ) ,
33
35
}
34
36
35
37
/// The representation of a Rust procedure (`proc()`)
38
+ #[ repr( C ) ]
36
39
pub struct Procedure {
37
40
pub code : * mut ( ) ,
38
41
pub env : * mut ( ) ,
@@ -42,6 +45,7 @@ pub struct Procedure {
42
45
///
43
46
/// This struct does not have a `Repr` implementation
44
47
/// because there is no way to refer to all trait objects generically.
48
+ #[ repr( C ) ]
45
49
pub struct TraitObject {
46
50
pub data : * mut ( ) ,
47
51
pub vtable : * mut ( ) ,
@@ -60,4 +64,3 @@ pub trait Repr<T> {
60
64
61
65
impl < ' a , T > Repr < Slice < T > > for & ' a [ T ] { }
62
66
impl < ' a > Repr < Slice < u8 > > for & ' a str { }
63
-
You can’t perform that action at this time.
0 commit comments