File tree Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ mod test {
136
136
137
137
use enum_set:: * ;
138
138
139
- #[ deriving( Eq ) ]
139
+ #[ deriving( Eq ) ] # [ repr ( uint ) ]
140
140
enum Foo {
141
141
A , B , C
142
142
}
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ pub static Vector: TypeKind = 13;
145
145
pub static Metadata : TypeKind = 14 ;
146
146
pub static X86_MMX : TypeKind = 15 ;
147
147
148
+ #[ repr( C ) ]
148
149
pub enum AtomicBinOp {
149
150
Xchg = 0 ,
150
151
Add = 1 ,
@@ -159,6 +160,7 @@ pub enum AtomicBinOp {
159
160
UMin = 10 ,
160
161
}
161
162
163
+ #[ repr( C ) ]
162
164
pub enum AtomicOrdering {
163
165
NotAtomic = 0 ,
164
166
Unordered = 1 ,
@@ -171,6 +173,7 @@ pub enum AtomicOrdering {
171
173
}
172
174
173
175
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
176
+ #[ repr( C ) ]
174
177
pub enum FileType {
175
178
AssemblyFile = 0 ,
176
179
ObjectFile = 1
@@ -192,20 +195,23 @@ pub enum AsmDialect {
192
195
}
193
196
194
197
#[ deriving( Eq ) ]
198
+ #[ repr( C ) ]
195
199
pub enum CodeGenOptLevel {
196
200
CodeGenLevelNone = 0 ,
197
201
CodeGenLevelLess = 1 ,
198
202
CodeGenLevelDefault = 2 ,
199
203
CodeGenLevelAggressive = 3 ,
200
204
}
201
205
206
+ #[ repr( C ) ]
202
207
pub enum RelocMode {
203
208
RelocDefault = 0 ,
204
209
RelocStatic = 1 ,
205
210
RelocPIC = 2 ,
206
211
RelocDynamicNoPic = 3 ,
207
212
}
208
213
214
+ #[ repr( C ) ]
209
215
pub enum CodeGenModel {
210
216
CodeModelDefault = 0 ,
211
217
CodeModelJITDefault = 1 ,
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ pub static tag_items_data_item_reexport_def_id: uint = 0x4e;
111
111
pub static tag_items_data_item_reexport_name: uint = 0x4f ;
112
112
113
113
// used to encode crate_ctxt side tables
114
- #[ deriving( Eq ) ]
114
+ #[ deriving( Eq ) ] # [ repr ( uint ) ]
115
115
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
116
116
tag_ast = 0x50 ,
117
117
@@ -143,7 +143,7 @@ impl astencode_tag {
143
143
pub fn from_uint ( value : uint ) -> Option < astencode_tag > {
144
144
let is_a_tag = first_astencode_tag <= value && value <= last_astencode_tag;
145
145
if !is_a_tag { None } else {
146
- Some ( unsafe { cast:: transmute ( value as int ) } )
146
+ Some ( unsafe { cast:: transmute ( value) } )
147
147
}
148
148
}
149
149
}
Original file line number Diff line number Diff line change @@ -712,7 +712,7 @@ pub struct ParamBounds {
712
712
713
713
pub type BuiltinBounds = EnumSet < BuiltinBound > ;
714
714
715
- #[ deriving( Clone , Eq , IterBytes , ToStr ) ]
715
+ #[ deriving( Clone , Eq , IterBytes , ToStr ) ] # [ repr ( uint ) ]
716
716
pub enum BuiltinBound {
717
717
BoundStatic ,
718
718
BoundSend ,
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ pub mod pipes {
26
26
payload : Option < T >
27
27
}
28
28
29
- #[ deriving( Eq ) ]
29
+ #[ deriving( Eq ) ] # [ repr ( int ) ]
30
30
pub enum state {
31
31
empty,
32
32
full,
You can’t perform that action at this time.
0 commit comments