@@ -966,10 +966,6 @@ pub struct GlobalCtxt<'tcx> {
966966 /// Resolutions of `extern crate` items produced by resolver.
967967 extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
968968
969- /// Map indicating what traits are in scope for places where this
970- /// is relevant; generated by resolve.
971- trait_map : FxHashMap < LocalDefId , FxHashMap < ItemLocalId , StableVec < TraitCandidate > > > ,
972-
973969 /// Export map produced by name resolution.
974970 export_map : ExportMap < LocalDefId > ,
975971
@@ -1150,12 +1146,6 @@ impl<'tcx> TyCtxt<'tcx> {
11501146 let common_consts = CommonConsts :: new ( & interners, & common_types) ;
11511147 let cstore = resolutions. cstore ;
11521148
1153- let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
1154- for ( hir_id, v) in krate. trait_map . iter ( ) {
1155- let map = trait_map. entry ( hir_id. owner ) . or_default ( ) ;
1156- map. insert ( hir_id. local_id , StableVec :: new ( v. to_vec ( ) ) ) ;
1157- }
1158-
11591149 GlobalCtxt {
11601150 sess : s,
11611151 lint_store,
@@ -1169,7 +1159,6 @@ impl<'tcx> TyCtxt<'tcx> {
11691159 consts : common_consts,
11701160 visibilities : resolutions. visibilities ,
11711161 extern_crate_map : resolutions. extern_crate_map ,
1172- trait_map,
11731162 export_map : resolutions. export_map ,
11741163 maybe_unused_trait_imports : resolutions. maybe_unused_trait_imports ,
11751164 maybe_unused_extern_crates : resolutions. maybe_unused_extern_crates ,
@@ -2793,7 +2782,7 @@ fn ptr_eq<T, U>(t: *const T, u: *const U) -> bool {
27932782}
27942783
27952784pub fn provide ( providers : & mut ty:: query:: Providers ) {
2796- providers. in_scope_traits_map = |tcx, id| tcx. gcx . trait_map . get ( & id) ;
2785+ providers. in_scope_traits_map = |tcx, id| tcx. hir_crate ( ( ) ) . trait_map . get ( & id) ;
27972786 providers. module_exports = |tcx, id| tcx. gcx . export_map . get ( & id) . map ( |v| & v[ ..] ) ;
27982787 providers. crate_name = |tcx, id| {
27992788 assert_eq ! ( id, LOCAL_CRATE ) ;
0 commit comments