@@ -906,6 +906,10 @@ impl EncodeContext<'a, 'tcx> {
906
906
let g = tcx. generics_of ( def_id) ;
907
907
record ! ( self . tables. generics[ def_id] <- g) ;
908
908
record ! ( self . tables. explicit_predicates[ def_id] <- self . tcx. explicit_predicates_of( def_id) ) ;
909
+ let inferred_outlives = self . tcx . inferred_outlives_of ( def_id) ;
910
+ if !inferred_outlives. is_empty ( ) {
911
+ record ! ( self . tables. inferred_outlives[ def_id] <- inferred_outlives) ;
912
+ }
909
913
}
910
914
let inherent_impls = tcx. crate_inherent_impls ( LOCAL_CRATE ) ;
911
915
for ( def_id, implementations) in inherent_impls. inherent_impls . iter ( ) {
@@ -951,7 +955,6 @@ impl EncodeContext<'a, 'tcx> {
951
955
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( ctor_def_id) ) ;
952
956
}
953
957
}
954
- self . encode_inferred_outlives ( def_id) ;
955
958
}
956
959
957
960
fn encode_enum_variant_ctor ( & mut self , def : & ty:: AdtDef , index : VariantIdx ) {
@@ -973,7 +976,6 @@ impl EncodeContext<'a, 'tcx> {
973
976
if variant. ctor_kind == CtorKind :: Fn {
974
977
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
975
978
}
976
- self . encode_inferred_outlives ( def_id) ;
977
979
}
978
980
979
981
fn encode_info_for_mod ( & mut self , local_def_id : LocalDefId , md : & hir:: Mod < ' _ > ) {
@@ -1032,7 +1034,6 @@ impl EncodeContext<'a, 'tcx> {
1032
1034
record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
1033
1035
self . encode_ident_span ( def_id, field. ident ) ;
1034
1036
self . encode_item_type ( def_id) ;
1035
- self . encode_inferred_outlives ( def_id) ;
1036
1037
}
1037
1038
1038
1039
fn encode_struct_ctor ( & mut self , adt_def : & ty:: AdtDef , def_id : DefId ) {
@@ -1052,15 +1053,6 @@ impl EncodeContext<'a, 'tcx> {
1052
1053
if variant. ctor_kind == CtorKind :: Fn {
1053
1054
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
1054
1055
}
1055
- self . encode_inferred_outlives ( def_id) ;
1056
- }
1057
-
1058
- fn encode_inferred_outlives ( & mut self , def_id : DefId ) {
1059
- debug ! ( "EncodeContext::encode_inferred_outlives({:?})" , def_id) ;
1060
- let inferred_outlives = self . tcx . inferred_outlives_of ( def_id) ;
1061
- if !inferred_outlives. is_empty ( ) {
1062
- record ! ( self . tables. inferred_outlives[ def_id] <- inferred_outlives) ;
1063
- }
1064
1056
}
1065
1057
1066
1058
fn encode_super_predicates ( & mut self , def_id : DefId ) {
@@ -1143,7 +1135,6 @@ impl EncodeContext<'a, 'tcx> {
1143
1135
if trait_item. kind == ty:: AssocKind :: Fn {
1144
1136
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
1145
1137
}
1146
- self . encode_inferred_outlives ( def_id) ;
1147
1138
}
1148
1139
1149
1140
fn encode_info_for_impl_item ( & mut self , def_id : DefId ) {
@@ -1201,7 +1192,6 @@ impl EncodeContext<'a, 'tcx> {
1201
1192
if impl_item. kind == ty:: AssocKind :: Fn {
1202
1193
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
1203
1194
}
1204
- self . encode_inferred_outlives ( def_id) ;
1205
1195
}
1206
1196
1207
1197
fn encode_fn_param_names_for_body ( & mut self , body_id : hir:: BodyId ) -> Lazy < [ Ident ] > {
@@ -1466,22 +1456,6 @@ impl EncodeContext<'a, 'tcx> {
1466
1456
record ! ( self . tables. impl_trait_ref[ def_id] <- trait_ref) ;
1467
1457
}
1468
1458
}
1469
- match item. kind {
1470
- hir:: ItemKind :: Static ( ..)
1471
- | hir:: ItemKind :: Const ( ..)
1472
- | hir:: ItemKind :: Fn ( ..)
1473
- | hir:: ItemKind :: TyAlias ( ..)
1474
- | hir:: ItemKind :: Enum ( ..)
1475
- | hir:: ItemKind :: Struct ( ..)
1476
- | hir:: ItemKind :: Union ( ..)
1477
- | hir:: ItemKind :: Impl { .. }
1478
- | hir:: ItemKind :: OpaqueTy ( ..)
1479
- | hir:: ItemKind :: Trait ( ..)
1480
- | hir:: ItemKind :: TraitAlias ( ..) => {
1481
- self . encode_inferred_outlives ( def_id) ;
1482
- }
1483
- _ => { }
1484
- }
1485
1459
match item. kind {
1486
1460
hir:: ItemKind :: Trait ( ..) | hir:: ItemKind :: TraitAlias ( ..) => {
1487
1461
self . encode_super_predicates ( def_id) ;
@@ -1539,7 +1513,6 @@ impl EncodeContext<'a, 'tcx> {
1539
1513
1540
1514
record ! ( self . tables. kind[ def_id. to_def_id( ) ] <- EntryKind :: AnonConst ( qualifs, const_data) ) ;
1541
1515
self . encode_item_type ( def_id. to_def_id ( ) ) ;
1542
- self . encode_inferred_outlives ( def_id. to_def_id ( ) ) ;
1543
1516
}
1544
1517
1545
1518
fn encode_native_libraries ( & mut self ) -> Lazy < [ NativeLib ] > {
@@ -1819,7 +1792,6 @@ impl EncodeContext<'a, 'tcx> {
1819
1792
if let hir:: ForeignItemKind :: Fn ( ..) = nitem. kind {
1820
1793
record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
1821
1794
}
1822
- self . encode_inferred_outlives ( def_id) ;
1823
1795
}
1824
1796
}
1825
1797
0 commit comments