@@ -966,10 +966,6 @@ pub struct GlobalCtxt<'tcx> {
966
966
/// Resolutions of `extern crate` items produced by resolver.
967
967
extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
968
968
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
-
973
969
/// Export map produced by name resolution.
974
970
export_map : ExportMap < LocalDefId > ,
975
971
@@ -1150,12 +1146,6 @@ impl<'tcx> TyCtxt<'tcx> {
1150
1146
let common_consts = CommonConsts :: new ( & interners, & common_types) ;
1151
1147
let cstore = resolutions. cstore ;
1152
1148
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
-
1159
1149
GlobalCtxt {
1160
1150
sess : s,
1161
1151
lint_store,
@@ -1169,7 +1159,6 @@ impl<'tcx> TyCtxt<'tcx> {
1169
1159
consts : common_consts,
1170
1160
visibilities : resolutions. visibilities ,
1171
1161
extern_crate_map : resolutions. extern_crate_map ,
1172
- trait_map,
1173
1162
export_map : resolutions. export_map ,
1174
1163
maybe_unused_trait_imports : resolutions. maybe_unused_trait_imports ,
1175
1164
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 {
2793
2782
}
2794
2783
2795
2784
pub 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) ;
2797
2786
providers. module_exports = |tcx, id| tcx. gcx . export_map . get ( & id) . map ( |v| & v[ ..] ) ;
2798
2787
providers. crate_name = |tcx, id| {
2799
2788
assert_eq ! ( id, LOCAL_CRATE ) ;
0 commit comments