@@ -865,6 +865,17 @@ impl EncodeContext<'a, 'tcx> {
865
865
self . encode_deprecation ( def_id) ;
866
866
}
867
867
}
868
+ let inherent_impls = tcx. crate_inherent_impls ( LOCAL_CRATE ) ;
869
+ for ( def_id, implementations) in inherent_impls. inherent_impls . iter ( ) {
870
+ assert ! ( def_id. is_local( ) ) ;
871
+ if implementations. is_empty ( ) {
872
+ continue ;
873
+ }
874
+ record ! ( self . tables. inherent_impls[ def_id] <- implementations. iter( ) . map( |& def_id| {
875
+ assert!( def_id. is_local( ) ) ;
876
+ def_id. index
877
+ } ) ) ;
878
+ }
868
879
}
869
880
870
881
fn encode_variances_of ( & mut self , def_id : DefId ) {
@@ -1237,18 +1248,6 @@ impl EncodeContext<'a, 'tcx> {
1237
1248
}
1238
1249
}
1239
1250
1240
- // Encodes the inherent implementations of a structure, enumeration, or trait.
1241
- fn encode_inherent_implementations ( & mut self , def_id : DefId ) {
1242
- debug ! ( "EncodeContext::encode_inherent_implementations({:?})" , def_id) ;
1243
- let implementations = self . tcx . inherent_impls ( def_id) ;
1244
- if !implementations. is_empty ( ) {
1245
- record ! ( self . tables. inherent_impls[ def_id] <- implementations. iter( ) . map( |& def_id| {
1246
- assert!( def_id. is_local( ) ) ;
1247
- def_id. index
1248
- } ) ) ;
1249
- }
1250
- }
1251
-
1252
1251
fn encode_stability ( & mut self , def_id : DefId ) {
1253
1252
debug ! ( "EncodeContext::encode_stability({:?})" , def_id) ;
1254
1253
@@ -1459,7 +1458,6 @@ impl EncodeContext<'a, 'tcx> {
1459
1458
record ! ( self . tables. impl_trait_ref[ def_id] <- trait_ref) ;
1460
1459
}
1461
1460
}
1462
- self . encode_inherent_implementations ( def_id) ;
1463
1461
match item. kind {
1464
1462
hir:: ItemKind :: Enum ( ..)
1465
1463
| hir:: ItemKind :: Struct ( ..)
@@ -1822,7 +1820,6 @@ impl EncodeContext<'a, 'tcx> {
1822
1820
}
1823
1821
self . encode_ident_span ( def_id, nitem. ident ) ;
1824
1822
self . encode_item_type ( def_id) ;
1825
- self . encode_inherent_implementations ( def_id) ;
1826
1823
if let hir:: ForeignItemKind :: Fn ( ..) = nitem. kind {
1827
1824
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
1828
1825
self . encode_variances_of ( def_id) ;
0 commit comments