@@ -1064,8 +1064,8 @@ pub struct GlobalCtxt<'tcx> {
10641064 /// Map indicating what traits are in scope for places where this
10651065 /// is relevant; generated by resolve.
10661066 trait_map : FxHashMap < DefIndex ,
1067- Lrc < FxHashMap < ItemLocalId ,
1068- Lrc < StableVec < TraitCandidate > > > > > ,
1067+ FxHashMap < ItemLocalId ,
1068+ StableVec < TraitCandidate > > > ,
10691069
10701070 /// Export map produced by name resolution.
10711071 export_map : FxHashMap < DefId , Lrc < Vec < Export < hir:: HirId > > > > ,
@@ -1305,13 +1305,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
13051305 None
13061306 } ;
13071307
1308- let mut trait_map: FxHashMap < _ , Lrc < FxHashMap < _ , _ > > > = FxHashMap :: default ( ) ;
1308+ let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
13091309 for ( k, v) in resolutions. trait_map {
13101310 let hir_id = hir. node_to_hir_id ( k) ;
13111311 let map = trait_map. entry ( hir_id. owner ) . or_default ( ) ;
1312- Lrc :: get_mut ( map) . unwrap ( )
1313- . insert ( hir_id. local_id ,
1314- Lrc :: new ( StableVec :: new ( v) ) ) ;
1312+ map. insert ( hir_id. local_id , StableVec :: new ( v) ) ;
13151313 }
13161314
13171315 GlobalCtxt {
@@ -2979,9 +2977,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
29792977 lint:: struct_lint_level ( self . sess , lint, level, src, None , msg)
29802978 }
29812979
2982- pub fn in_scope_traits ( self , id : HirId ) -> Option < Lrc < StableVec < TraitCandidate > > > {
2980+ pub fn in_scope_traits ( self , id : HirId ) -> Option < & ' gcx StableVec < TraitCandidate > > {
29832981 self . in_scope_traits_map ( id. owner )
2984- . and_then ( |map| map. get ( & id. local_id ) . cloned ( ) )
2982+ . and_then ( |map| map. get ( & id. local_id ) )
29852983 }
29862984
29872985 pub fn named_region ( self , id : HirId ) -> Option < resolve_lifetime:: Region > {
@@ -3054,7 +3052,7 @@ fn ptr_eq<T, U>(t: *const T, u: *const U) -> bool {
30543052}
30553053
30563054pub fn provide ( providers : & mut ty:: query:: Providers < ' _ > ) {
3057- providers. in_scope_traits_map = |tcx, id| tcx. gcx . trait_map . get ( & id) . cloned ( ) ;
3055+ providers. in_scope_traits_map = |tcx, id| tcx. gcx . trait_map . get ( & id) ;
30583056 providers. module_exports = |tcx, id| tcx. gcx . export_map . get ( & id) . cloned ( ) ;
30593057 providers. crate_name = |tcx, id| {
30603058 assert_eq ! ( id, LOCAL_CRATE ) ;
0 commit comments