@@ -33,7 +33,7 @@ use rustc::ty::util::IntTypeExt;
33
33
use rustc:: hir:: svh:: Svh ;
34
34
use rustc:: mir:: mir_map:: MirMap ;
35
35
use rustc:: session:: config:: { self , PanicStrategy } ;
36
- use rustc:: util:: nodemap:: { FnvHashMap , NodeMap , NodeSet } ;
36
+ use rustc:: util:: nodemap:: { FnvHashMap , NodeSet } ;
37
37
38
38
use rustc_serialize:: Encodable ;
39
39
use std:: cell:: RefCell ;
@@ -58,7 +58,6 @@ pub struct EncodeContext<'a, 'tcx: 'a> {
58
58
pub diag : & ' a Handler ,
59
59
pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
60
60
pub reexports : & ' a def:: ExportMap ,
61
- pub item_symbols : & ' a RefCell < NodeMap < String > > ,
62
61
pub link_meta : & ' a LinkMeta ,
63
62
pub cstore : & ' a cstore:: CStore ,
64
63
pub type_abbrevs : tyencode:: abbrev_map < ' tcx > ,
@@ -204,20 +203,6 @@ fn encode_region(ecx: &EncodeContext,
204
203
rbml_w. end_tag ( ) ;
205
204
}
206
205
207
- fn encode_symbol ( ecx : & EncodeContext ,
208
- rbml_w : & mut Encoder ,
209
- id : NodeId ) {
210
- match ecx. item_symbols . borrow ( ) . get ( & id) {
211
- Some ( x) => {
212
- debug ! ( "encode_symbol(id={}, str={})" , id, * x) ;
213
- rbml_w. wr_tagged_str ( tag_items_data_item_symbol, x) ;
214
- }
215
- None => {
216
- bug ! ( "encode_symbol: id not found {}" , id) ;
217
- }
218
- }
219
- }
220
-
221
206
fn encode_disr_val ( _: & EncodeContext ,
222
207
rbml_w : & mut Encoder ,
223
208
disr_val : ty:: Disr ) {
@@ -512,10 +497,6 @@ fn encode_info_for_struct_ctor<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
512
497
encode_name ( rbml_w, name) ;
513
498
encode_parent_item ( rbml_w, ecx. tcx . map . local_def_id ( struct_id) ) ;
514
499
515
- if ecx. item_symbols . borrow ( ) . contains_key ( & ctor_id) {
516
- encode_symbol ( ecx, rbml_w, ctor_id) ;
517
- }
518
-
519
500
let stab = ecx. tcx . lookup_stability ( ecx. tcx . map . local_def_id ( ctor_id) ) ;
520
501
let depr= ecx. tcx . lookup_deprecation ( ecx. tcx . map . local_def_id ( ctor_id) ) ;
521
502
encode_stability ( rbml_w, stab) ;
@@ -704,10 +685,6 @@ fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
704
685
}
705
686
encode_constness ( rbml_w, sig. constness ) ;
706
687
encode_defaultness ( rbml_w, impl_item. defaultness ) ;
707
- if !any_types {
708
- let m_id = ecx. local_id ( m. def_id ) ;
709
- encode_symbol ( ecx, rbml_w, m_id) ;
710
- }
711
688
encode_method_argument_names ( rbml_w, & sig. decl ) ;
712
689
}
713
690
}
@@ -885,7 +862,6 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
885
862
encode_family ( rbml_w, 'c' ) ;
886
863
}
887
864
encode_bounds_and_type_for_item ( rbml_w, ecx, index, item. id ) ;
888
- encode_symbol ( ecx, rbml_w, item. id ) ;
889
865
encode_name ( rbml_w, item. name ) ;
890
866
encode_visibility ( rbml_w, vis) ;
891
867
encode_stability ( rbml_w, stab) ;
@@ -922,9 +898,6 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
922
898
encode_inlined_item ( ecx, rbml_w, InlinedItemRef :: Item ( item) ) ;
923
899
encode_mir ( ecx, rbml_w, item. id ) ;
924
900
}
925
- if tps_len == 0 {
926
- encode_symbol ( ecx, rbml_w, item. id ) ;
927
- }
928
901
encode_constness ( rbml_w, constness) ;
929
902
encode_visibility ( rbml_w, vis) ;
930
903
encode_stability ( rbml_w, stab) ;
@@ -1344,6 +1317,8 @@ fn encode_info_for_foreign_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
1344
1317
index. record ( def_id, rbml_w) ;
1345
1318
rbml_w. start_tag ( tag_items_data_item) ;
1346
1319
encode_def_id_and_key ( ecx, rbml_w, def_id) ;
1320
+ let parent_id = ecx. tcx . map . get_parent ( nitem. id ) ;
1321
+ encode_parent_item ( rbml_w, ecx. tcx . map . local_def_id ( parent_id) ) ;
1347
1322
encode_visibility ( rbml_w, & nitem. vis ) ;
1348
1323
match nitem. node {
1349
1324
hir:: ForeignItemFn ( ref fndecl, _) => {
@@ -1353,8 +1328,6 @@ fn encode_info_for_foreign_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
1353
1328
if abi == Abi :: RustIntrinsic || abi == Abi :: PlatformIntrinsic {
1354
1329
encode_inlined_item ( ecx, rbml_w, InlinedItemRef :: Foreign ( nitem) ) ;
1355
1330
encode_mir ( ecx, rbml_w, nitem. id ) ;
1356
- } else {
1357
- encode_symbol ( ecx, rbml_w, nitem. id ) ;
1358
1331
}
1359
1332
encode_attributes ( rbml_w, & nitem. attrs ) ;
1360
1333
let stab = ecx. tcx . lookup_stability ( ecx. tcx . map . local_def_id ( nitem. id ) ) ;
@@ -1375,7 +1348,6 @@ fn encode_info_for_foreign_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
1375
1348
let depr = ecx. tcx . lookup_deprecation ( ecx. tcx . map . local_def_id ( nitem. id ) ) ;
1376
1349
encode_stability ( rbml_w, stab) ;
1377
1350
encode_deprecation ( rbml_w, depr) ;
1378
- encode_symbol ( ecx, rbml_w, nitem. id ) ;
1379
1351
encode_name ( rbml_w, nitem. name ) ;
1380
1352
}
1381
1353
}
0 commit comments