@@ -319,7 +319,7 @@ fn encode_enum_variant_info(ecx: &EncodeContext,
319
319
id : NodeId ,
320
320
variants : & [ variant ] ,
321
321
path : & [ ast_map:: path_elt ] ,
322
- index : @mut ~[ entry < int > ] ,
322
+ index : @mut ~[ entry < i64 > ] ,
323
323
generics : & ast:: Generics ) {
324
324
debug ! ( "encode_enum_variant_info(id=%?)" , id) ;
325
325
@@ -329,7 +329,8 @@ fn encode_enum_variant_info(ecx: &EncodeContext,
329
329
ast:: def_id { crate : LOCAL_CRATE , node : id } ) ;
330
330
for variant in variants. iter ( ) {
331
331
let def_id = local_def ( variant. node . id ) ;
332
- index. push ( entry { val : variant. node . id , pos : ebml_w. writer . tell ( ) } ) ;
332
+ index. push ( entry { val : variant. node . id as i64 ,
333
+ pos : ebml_w. writer . tell ( ) } ) ;
333
334
ebml_w. start_tag ( tag_items_data_item) ;
334
335
encode_def_id ( ebml_w, def_id) ;
335
336
encode_family ( ebml_w, 'v' ) ;
@@ -677,8 +678,8 @@ fn encode_info_for_struct(ecx: &EncodeContext,
677
678
ebml_w : & mut writer:: Encoder ,
678
679
path : & [ ast_map:: path_elt ] ,
679
680
fields : & [ @struct_field ] ,
680
- global_index : @mut ~[ entry < int > ] )
681
- -> ~[ entry < int > ] {
681
+ global_index : @mut ~[ entry < i64 > ] )
682
+ -> ~[ entry < i64 > ] {
682
683
/* Each class has its own index, since different classes
683
684
may have fields with the same name */
684
685
let mut index = ~[ ] ;
@@ -692,8 +693,8 @@ fn encode_info_for_struct(ecx: &EncodeContext,
692
693
} ;
693
694
694
695
let id = field. node . id ;
695
- index. push ( entry { val : id, pos : ebml_w. writer . tell ( ) } ) ;
696
- global_index. push ( entry { val : id, pos : ebml_w. writer . tell ( ) } ) ;
696
+ index. push ( entry { val : id as i64 , pos : ebml_w. writer . tell ( ) } ) ;
697
+ global_index. push ( entry { val : id as i64 , pos : ebml_w. writer . tell ( ) } ) ;
697
698
ebml_w. start_tag ( tag_items_data_item) ;
698
699
debug ! ( "encode_info_for_struct: doing %s %d" ,
699
700
tcx. sess. str_of( nm) , id) ;
@@ -712,8 +713,8 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
712
713
path : & [ ast_map:: path_elt ] ,
713
714
name : ast:: ident ,
714
715
ctor_id : NodeId ,
715
- index : @mut ~[ entry < int > ] ) {
716
- index. push ( entry { val : ctor_id, pos : ebml_w. writer . tell ( ) } ) ;
716
+ index : @mut ~[ entry < i64 > ] ) {
717
+ index. push ( entry { val : ctor_id as i64 , pos : ebml_w. writer . tell ( ) } ) ;
717
718
718
719
ebml_w. start_tag ( tag_items_data_item) ;
719
720
encode_def_id ( ebml_w, local_def ( ctor_id) ) ;
@@ -815,13 +816,13 @@ fn should_inline(attrs: &[Attribute]) -> bool {
815
816
fn encode_info_for_item ( ecx : & EncodeContext ,
816
817
ebml_w : & mut writer:: Encoder ,
817
818
item: @item,
818
- index : @mut ~[ entry < int > ] ,
819
+ index : @mut ~[ entry < i64 > ] ,
819
820
path : & [ ast_map:: path_elt ] ) {
820
821
let tcx = ecx. tcx ;
821
822
822
823
fn add_to_index_ ( item : @item, ebml_w : & writer:: Encoder ,
823
- index : @mut ~[ entry < int > ] ) {
824
- index. push ( entry { val : item. id , pos : ebml_w. writer . tell ( ) } ) ;
824
+ index : @mut ~[ entry < i64 > ] ) {
825
+ index. push ( entry { val : item. id as i64 , pos : ebml_w. writer . tell ( ) } ) ;
825
826
}
826
827
let add_to_index: & fn ( ) = || add_to_index_ ( item, ebml_w, index) ;
827
828
@@ -969,7 +970,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
969
970
970
971
/* Each class has its own index -- encode it */
971
972
let bkts = create_index ( idx) ;
972
- encode_index ( ebml_w, bkts, write_int ) ;
973
+ encode_index ( ebml_w, bkts, write_i64 ) ;
973
974
ebml_w. end_tag ( ) ;
974
975
975
976
// If this is a tuple- or enum-like struct, encode the type of the
@@ -1040,7 +1041,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
1040
1041
Some ( ast_methods[ i] )
1041
1042
} else { None } ;
1042
1043
1043
- index. push ( entry { val : m. def_id . node , pos : ebml_w. writer . tell ( ) } ) ;
1044
+ index. push ( entry { val : m. def_id . node as i64 ,
1045
+ pos : ebml_w. writer . tell ( ) } ) ;
1044
1046
encode_info_for_method ( ecx,
1045
1047
ebml_w,
1046
1048
* m,
@@ -1086,7 +1088,8 @@ fn encode_info_for_item(ecx: &EncodeContext,
1086
1088
1087
1089
let method_ty = ty:: method ( tcx, method_def_id) ;
1088
1090
1089
- index. push ( entry { val : method_def_id. node , pos : ebml_w. writer . tell ( ) } ) ;
1091
+ index. push ( entry { val : method_def_id. node as i64 ,
1092
+ pos : ebml_w. writer . tell ( ) } ) ;
1090
1093
1091
1094
ebml_w. start_tag ( tag_items_data_item) ;
1092
1095
@@ -1145,10 +1148,10 @@ fn encode_info_for_item(ecx: &EncodeContext,
1145
1148
fn encode_info_for_foreign_item ( ecx : & EncodeContext ,
1146
1149
ebml_w : & mut writer:: Encoder ,
1147
1150
nitem : @foreign_item ,
1148
- index : @mut ~[ entry < int > ] ,
1151
+ index : @mut ~[ entry < i64 > ] ,
1149
1152
path : & ast_map:: path ,
1150
1153
abi : AbiSet ) {
1151
- index. push ( entry { val : nitem. id , pos : ebml_w. writer . tell ( ) } ) ;
1154
+ index. push ( entry { val : nitem. id as i64 , pos : ebml_w. writer . tell ( ) } ) ;
1152
1155
1153
1156
ebml_w. start_tag ( tag_items_data_item) ;
1154
1157
match nitem. node {
@@ -1184,10 +1187,10 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
1184
1187
fn encode_info_for_items ( ecx : & EncodeContext ,
1185
1188
ebml_w : & mut writer:: Encoder ,
1186
1189
crate : & Crate )
1187
- -> ~[ entry < int > ] {
1190
+ -> ~[ entry < i64 > ] {
1188
1191
let index = @mut ~[ ] ;
1189
1192
ebml_w. start_tag ( tag_items_data) ;
1190
- index. push ( entry { val : CRATE_NODE_ID , pos : ebml_w. writer . tell ( ) } ) ;
1193
+ index. push ( entry { val : CRATE_NODE_ID as i64 , pos : ebml_w. writer . tell ( ) } ) ;
1191
1194
encode_info_for_mod ( ecx,
1192
1195
ebml_w,
1193
1196
& crate . module,
@@ -1304,7 +1307,7 @@ fn write_str(writer: @io::Writer, s: ~str) {
1304
1307
writer. write_str ( s) ;
1305
1308
}
1306
1309
1307
- fn write_int ( writer : @io:: Writer , & n: & int ) {
1310
+ fn write_i64 ( writer : @io:: Writer , & n: & i64 ) {
1308
1311
assert ! ( n < 0x7fff_ffff ) ;
1309
1312
writer. write_be_u32 ( n as u32 ) ;
1310
1313
}
@@ -1623,7 +1626,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
1623
1626
1624
1627
i = * wr. pos ;
1625
1628
let items_buckets = create_index ( items_index) ;
1626
- encode_index ( & mut ebml_w, items_buckets, write_int ) ;
1629
+ encode_index ( & mut ebml_w, items_buckets, write_i64 ) ;
1627
1630
ecx. stats . index_bytes = * wr. pos - i;
1628
1631
ebml_w. end_tag ( ) ;
1629
1632
0 commit comments