@@ -906,6 +906,10 @@ impl EncodeContext<'a, 'tcx> {
906906 let g = tcx. generics_of ( def_id) ;
907907 record ! ( self . tables. generics[ def_id] <- g) ;
908908 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+ }
909913 }
910914 let inherent_impls = tcx. crate_inherent_impls ( LOCAL_CRATE ) ;
911915 for ( def_id, implementations) in inherent_impls. inherent_impls . iter ( ) {
@@ -951,7 +955,6 @@ impl EncodeContext<'a, 'tcx> {
951955 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( ctor_def_id) ) ;
952956 }
953957 }
954- self . encode_inferred_outlives ( def_id) ;
955958 }
956959
957960 fn encode_enum_variant_ctor ( & mut self , def : & ty:: AdtDef , index : VariantIdx ) {
@@ -973,7 +976,6 @@ impl EncodeContext<'a, 'tcx> {
973976 if variant. ctor_kind == CtorKind :: Fn {
974977 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
975978 }
976- self . encode_inferred_outlives ( def_id) ;
977979 }
978980
979981 fn encode_info_for_mod ( & mut self , local_def_id : LocalDefId , md : & hir:: Mod < ' _ > ) {
@@ -1032,7 +1034,6 @@ impl EncodeContext<'a, 'tcx> {
10321034 record ! ( self . tables. kind[ def_id] <- EntryKind :: Field ) ;
10331035 self . encode_ident_span ( def_id, field. ident ) ;
10341036 self . encode_item_type ( def_id) ;
1035- self . encode_inferred_outlives ( def_id) ;
10361037 }
10371038
10381039 fn encode_struct_ctor ( & mut self , adt_def : & ty:: AdtDef , def_id : DefId ) {
@@ -1052,15 +1053,6 @@ impl EncodeContext<'a, 'tcx> {
10521053 if variant. ctor_kind == CtorKind :: Fn {
10531054 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
10541055 }
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- }
10641056 }
10651057
10661058 fn encode_super_predicates ( & mut self , def_id : DefId ) {
@@ -1143,7 +1135,6 @@ impl EncodeContext<'a, 'tcx> {
11431135 if trait_item. kind == ty:: AssocKind :: Fn {
11441136 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
11451137 }
1146- self . encode_inferred_outlives ( def_id) ;
11471138 }
11481139
11491140 fn encode_info_for_impl_item ( & mut self , def_id : DefId ) {
@@ -1201,7 +1192,6 @@ impl EncodeContext<'a, 'tcx> {
12011192 if impl_item. kind == ty:: AssocKind :: Fn {
12021193 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
12031194 }
1204- self . encode_inferred_outlives ( def_id) ;
12051195 }
12061196
12071197 fn encode_fn_param_names_for_body ( & mut self , body_id : hir:: BodyId ) -> Lazy < [ Ident ] > {
@@ -1466,22 +1456,6 @@ impl EncodeContext<'a, 'tcx> {
14661456 record ! ( self . tables. impl_trait_ref[ def_id] <- trait_ref) ;
14671457 }
14681458 }
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- }
14851459 match item. kind {
14861460 hir:: ItemKind :: Trait ( ..) | hir:: ItemKind :: TraitAlias ( ..) => {
14871461 self . encode_super_predicates ( def_id) ;
@@ -1539,7 +1513,6 @@ impl EncodeContext<'a, 'tcx> {
15391513
15401514 record ! ( self . tables. kind[ def_id. to_def_id( ) ] <- EntryKind :: AnonConst ( qualifs, const_data) ) ;
15411515 self . encode_item_type ( def_id. to_def_id ( ) ) ;
1542- self . encode_inferred_outlives ( def_id. to_def_id ( ) ) ;
15431516 }
15441517
15451518 fn encode_native_libraries ( & mut self ) -> Lazy < [ NativeLib ] > {
@@ -1819,7 +1792,6 @@ impl EncodeContext<'a, 'tcx> {
18191792 if let hir:: ForeignItemKind :: Fn ( ..) = nitem. kind {
18201793 record ! ( self . tables. fn_sig[ def_id] <- tcx. fn_sig( def_id) ) ;
18211794 }
1822- self . encode_inferred_outlives ( def_id) ;
18231795 }
18241796}
18251797
0 commit comments