@@ -43,7 +43,7 @@ use crate::ty::subst::{UserSubsts, GenericArgKind};
4343use crate :: ty:: { BoundVar , BindingMode } ;
4444use crate :: ty:: CanonicalPolyFnSig ;
4545use crate :: util:: common:: ErrorReported ;
46- use crate :: util:: nodemap:: { DefIdMap , DefIdSet , ItemLocalMap , ItemLocalSet } ;
46+ use crate :: util:: nodemap:: { DefIdMap , DefIdSet , ItemLocalMap , ItemLocalSet , NodeMap } ;
4747use crate :: util:: nodemap:: { FxHashMap , FxHashSet } ;
4848use crate :: util:: profiling:: SelfProfilerRef ;
4949
@@ -1051,6 +1051,9 @@ pub struct GlobalCtxt<'tcx> {
10511051 /// Common consts, pre-interned for your convenience.
10521052 pub consts : CommonConsts < ' tcx > ,
10531053
1054+ /// Resolutions of `extern crate` items produced by resolver.
1055+ extern_crate_map : NodeMap < CrateNum > ,
1056+
10541057 /// Map indicating what traits are in scope for places where this
10551058 /// is relevant; generated by resolve.
10561059 trait_map : FxHashMap < DefIndex ,
@@ -1274,6 +1277,7 @@ impl<'tcx> TyCtxt<'tcx> {
12741277 types : common_types,
12751278 lifetimes : common_lifetimes,
12761279 consts : common_consts,
1280+ extern_crate_map : resolutions. extern_crate_map ,
12771281 trait_map,
12781282 export_map : resolutions. export_map . into_iter ( ) . map ( |( k, v) | {
12791283 let exports: Vec < _ > = v. into_iter ( ) . map ( |e| {
@@ -2951,7 +2955,7 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
29512955 } ;
29522956 providers. extern_mod_stmt_cnum = |tcx, id| {
29532957 let id = tcx. hir ( ) . as_local_node_id ( id) . unwrap ( ) ;
2954- tcx. cstore . extern_mod_stmt_cnum_untracked ( id )
2958+ tcx. extern_crate_map . get ( & id ) . cloned ( )
29552959 } ;
29562960 providers. all_crate_nums = |tcx, cnum| {
29572961 assert_eq ! ( cnum, LOCAL_CRATE ) ;
0 commit comments