@@ -31,7 +31,7 @@ use rustc_serialize::{opaque, Encodable, Encoder};
3131use rustc_session:: config:: CrateType ;
3232use rustc_session:: cstore:: { ForeignModule , LinkagePreference , NativeLib } ;
3333use rustc_span:: hygiene:: { ExpnIndex , HygieneEncodeContext , MacroKind } ;
34- use rustc_span:: symbol:: { sym, Ident , Symbol } ;
34+ use rustc_span:: symbol:: { sym, Symbol } ;
3535use rustc_span:: {
3636 self , DebuggerVisualizerFile , ExternalSource , FileName , SourceFile , Span , SyntaxContext ,
3737} ;
@@ -1007,6 +1007,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
10071007 record ! ( self . tables. def_span[ def_id] <- tcx. def_span( def_id) ) ;
10081008 self . encode_attrs ( local_id) ;
10091009 record ! ( self . tables. expn_that_defined[ def_id] <- self . tcx. expn_that_defined( def_id) ) ;
1010+ if let Some ( ident_span) = tcx. def_ident_span ( def_id) {
1011+ record ! ( self . tables. def_ident_span[ def_id] <- ident_span) ;
1012+ }
10101013 if def_kind. has_codegen_attrs ( ) {
10111014 record ! ( self . tables. codegen_fn_attrs[ def_id] <- self . tcx. codegen_fn_attrs( def_id) ) ;
10121015 }
@@ -1071,7 +1074,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
10711074 assert!( f. did. is_local( ) ) ;
10721075 f. did. index
10731076 } ) ) ;
1074- self . encode_ident_span ( def_id, variant. ident ( tcx) ) ;
10751077 self . encode_item_type ( def_id) ;
10761078 if variant. ctor_kind == CtorKind :: Fn {
10771079 // FIXME(eddyb) encode signature only in `encode_enum_variant_ctor`.
@@ -1163,7 +1165,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
11631165 debug ! ( "EncodeContext::encode_field({:?})" , def_id) ;
11641166
11651167 record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
1166- self . encode_ident_span ( def_id, field. ident ( self . tcx ) ) ;
11671168 self . encode_item_type ( def_id) ;
11681169 }
11691170
@@ -1242,7 +1243,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
12421243 record ! ( self . tables. kind[ def_id] <- EntryKind :: AssocType ( container) ) ;
12431244 }
12441245 }
1245- self . encode_ident_span ( def_id, ast_item. ident ) ;
12461246 match trait_item. kind {
12471247 ty:: AssocKind :: Const | ty:: AssocKind :: Fn => {
12481248 self . encode_item_type ( def_id) ;
@@ -1306,7 +1306,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
13061306 record ! ( self . tables. kind[ def_id] <- EntryKind :: AssocType ( container) ) ;
13071307 }
13081308 }
1309- self . encode_ident_span ( def_id, impl_item. ident ( self . tcx ) ) ;
13101309 self . encode_item_type ( def_id) ;
13111310 if let Some ( trait_item_def_id) = impl_item. trait_item_def_id {
13121311 self . tables . trait_item_def_id . set ( def_id. index , trait_item_def_id. into ( ) ) ;
@@ -1408,8 +1407,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
14081407
14091408 debug ! ( "EncodeContext::encode_info_for_item({:?})" , def_id) ;
14101409
1411- self . encode_ident_span ( def_id, item. ident ) ;
1412-
14131410 let entry_kind = match item. kind {
14141411 hir:: ItemKind :: Static ( ..) => EntryKind :: Static ,
14151412 hir:: ItemKind :: Const ( _, body_id) => {
@@ -1953,7 +1950,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
19531950 record ! ( self . tables. kind[ def_id] <- EntryKind :: ForeignType ) ;
19541951 }
19551952 }
1956- self . encode_ident_span ( def_id, nitem. ident ) ;
19571953 self . encode_item_type ( def_id) ;
19581954 if let hir:: ForeignItemKind :: Fn ( ..) = nitem. kind {
19591955 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
@@ -2035,10 +2031,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
20352031 }
20362032 }
20372033
2038- fn encode_ident_span ( & mut self , def_id : DefId , ident : Ident ) {
2039- record ! ( self . tables. def_ident_span[ def_id] <- ident. span) ;
2040- }
2041-
20422034 /// In some cases, along with the item itself, we also
20432035 /// encode some sub-items. Usually we want some info from the item
20442036 /// so it's easier to do that here then to wait until we would encounter
0 commit comments