11use hir:: Node ;
22use rustc_hir as hir;
3- use rustc_hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE } ;
3+ use rustc_hir:: def_id:: DefId ;
44use rustc_middle:: ty:: query:: Providers ;
55use rustc_middle:: ty:: subst:: GenericArgKind ;
66use rustc_middle:: ty:: { self , CratePredicatesMap , ToPredicate , TyCtxt } ;
@@ -23,7 +23,7 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
2323 match tcx. hir ( ) . get ( id) {
2424 Node :: Item ( item) => match item. kind {
2525 hir:: ItemKind :: Struct ( ..) | hir:: ItemKind :: Enum ( ..) | hir:: ItemKind :: Union ( ..) => {
26- let crate_map = tcx. inferred_outlives_crate ( LOCAL_CRATE ) ;
26+ let crate_map = tcx. inferred_outlives_crate ( ( ) ) ;
2727
2828 let predicates = crate_map. predicates . get ( & item_def_id) . copied ( ) . unwrap_or ( & [ ] ) ;
2929
@@ -58,9 +58,7 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
5858 }
5959}
6060
61- fn inferred_outlives_crate ( tcx : TyCtxt < ' _ > , crate_num : CrateNum ) -> CratePredicatesMap < ' _ > {
62- assert_eq ! ( crate_num, LOCAL_CRATE ) ;
63-
61+ fn inferred_outlives_crate ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> CratePredicatesMap < ' _ > {
6462 // Compute a map from each struct/enum/union S to the **explicit**
6563 // outlives predicates (`T: 'a`, `'a: 'b`) that the user wrote.
6664 // Typically there won't be many of these, except in older code where
0 commit comments