1
1
use hir:: Node ;
2
2
use rustc_hir as hir;
3
- use rustc_hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE } ;
3
+ use rustc_hir:: def_id:: DefId ;
4
4
use rustc_middle:: ty:: query:: Providers ;
5
5
use rustc_middle:: ty:: subst:: GenericArgKind ;
6
6
use rustc_middle:: ty:: { self , CratePredicatesMap , ToPredicate , TyCtxt } ;
@@ -23,7 +23,7 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
23
23
match tcx. hir ( ) . get ( id) {
24
24
Node :: Item ( item) => match item. kind {
25
25
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 ( ( ) ) ;
27
27
28
28
let predicates = crate_map. predicates . get ( & item_def_id) . copied ( ) . unwrap_or ( & [ ] ) ;
29
29
@@ -58,9 +58,7 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
58
58
}
59
59
}
60
60
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 < ' _ > {
64
62
// Compute a map from each struct/enum/union S to the **explicit**
65
63
// outlives predicates (`T: 'a`, `'a: 'b`) that the user wrote.
66
64
// Typically there won't be many of these, except in older code where
0 commit comments