@@ -40,7 +40,6 @@ use std::io::prelude::*;
4040use std:: io:: { Cursor , SeekFrom } ;
4141use std:: rc:: Rc ;
4242use std:: u32;
43- use syntax:: abi:: Abi ;
4443use syntax:: ast:: { self , NodeId , Name , CRATE_NODE_ID , CrateNum } ;
4544use syntax:: attr:: { self , AttrMetaMethods , AttributeMethods } ;
4645use errors:: Handler ;
@@ -626,11 +625,6 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
626625
627626 if body. is_some ( ) {
628627 encode_item_sort ( self . rbml_w , 'p' ) ;
629- encode_inlined_item ( ecx,
630- self . rbml_w ,
631- InlinedItemRef :: TraitItem (
632- trait_def_id,
633- trait_item) ) ;
634628 self . encode_mir ( trait_item. id ) ;
635629 } else {
636630 encode_item_sort ( self . rbml_w , 'r' ) ;
@@ -728,12 +722,14 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
728722 let types = generics. parent_types as usize + generics. types . len ( ) ;
729723 let needs_inline = types > 0 || is_default_impl ||
730724 attr:: requests_inline ( & impl_item. attrs ) ;
731- if needs_inline || sig. constness == hir:: Constness :: Const {
725+ if sig. constness == hir:: Constness :: Const {
732726 encode_inlined_item (
733727 ecx,
734728 self . rbml_w ,
735729 InlinedItemRef :: ImplItem ( ecx. tcx . map . local_def_id ( parent_id) ,
736730 impl_item) ) ;
731+ }
732+ if needs_inline || sig. constness == hir:: Constness :: Const {
737733 self . encode_mir ( impl_item. id ) ;
738734 }
739735 encode_constness ( self . rbml_w , sig. constness ) ;
@@ -934,8 +930,10 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
934930 encode_name ( self . rbml_w , item. name ) ;
935931 encode_attributes ( self . rbml_w , & item. attrs ) ;
936932 let needs_inline = tps_len > 0 || attr:: requests_inline ( & item. attrs ) ;
937- if needs_inline || constness == hir:: Constness :: Const {
933+ if constness == hir:: Constness :: Const {
938934 encode_inlined_item ( ecx, self . rbml_w , InlinedItemRef :: Item ( def_id, item) ) ;
935+ }
936+ if needs_inline || constness == hir:: Constness :: Const {
939937 self . encode_mir ( item. id ) ;
940938 }
941939 encode_constness ( self . rbml_w , constness) ;
@@ -982,8 +980,6 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
982980 for v in & enum_definition. variants {
983981 encode_variant_id ( self . rbml_w , ecx. tcx . map . local_def_id ( v. node . data . id ( ) ) ) ;
984982 }
985- encode_inlined_item ( ecx, self . rbml_w , InlinedItemRef :: Item ( def_id, item) ) ;
986- self . encode_mir ( item. id ) ;
987983
988984 // Encode inherent implementations for self enumeration.
989985 encode_inherent_implementations ( ecx, self . rbml_w , def_id) ;
@@ -1019,9 +1015,6 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
10191015 needs to know*/
10201016 self . encode_struct_fields ( variant) ;
10211017
1022- encode_inlined_item ( ecx, self . rbml_w , InlinedItemRef :: Item ( def_id, item) ) ;
1023- self . encode_mir ( item. id ) ;
1024-
10251018 // Encode inherent implementations for self structure.
10261019 encode_inherent_implementations ( ecx, self . rbml_w , def_id) ;
10271020
@@ -1265,7 +1258,6 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
12651258 let ecx = self . ecx ( ) ;
12661259
12671260 debug ! ( "writing foreign item {}" , ecx. tcx. node_path_str( nitem. id) ) ;
1268- let abi = ecx. tcx . map . get_foreign_abi ( nitem. id ) ;
12691261
12701262 encode_def_id_and_key ( ecx, self . rbml_w , def_id) ;
12711263 let parent_id = ecx. tcx . map . get_parent ( nitem. id ) ;
@@ -1276,12 +1268,6 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
12761268 encode_family ( self . rbml_w , FN_FAMILY ) ;
12771269 self . encode_bounds_and_type_for_item ( nitem. id ) ;
12781270 encode_name ( self . rbml_w , nitem. name ) ;
1279- if abi == Abi :: RustIntrinsic || abi == Abi :: PlatformIntrinsic {
1280- encode_inlined_item ( ecx,
1281- self . rbml_w ,
1282- InlinedItemRef :: Foreign ( def_id, nitem) ) ;
1283- self . encode_mir ( nitem. id ) ;
1284- }
12851271 encode_attributes ( self . rbml_w , & nitem. attrs ) ;
12861272 let stab = ecx. tcx . lookup_stability ( ecx. tcx . map . local_def_id ( nitem. id ) ) ;
12871273 let depr = ecx. tcx . lookup_deprecation ( ecx. tcx . map . local_def_id ( nitem. id ) ) ;
0 commit comments