@@ -1064,8 +1064,8 @@ pub struct GlobalCtxt<'tcx> {
1064
1064
/// Map indicating what traits are in scope for places where this
1065
1065
/// is relevant; generated by resolve.
1066
1066
trait_map : FxHashMap < DefIndex ,
1067
- Lrc < FxHashMap < ItemLocalId ,
1068
- Lrc < StableVec < TraitCandidate > > > > > ,
1067
+ FxHashMap < ItemLocalId ,
1068
+ StableVec < TraitCandidate > > > ,
1069
1069
1070
1070
/// Export map produced by name resolution.
1071
1071
export_map : FxHashMap < DefId , Lrc < Vec < Export < hir:: HirId > > > > ,
@@ -1305,13 +1305,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
1305
1305
None
1306
1306
} ;
1307
1307
1308
- let mut trait_map: FxHashMap < _ , Lrc < FxHashMap < _ , _ > > > = FxHashMap :: default ( ) ;
1308
+ let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
1309
1309
for ( k, v) in resolutions. trait_map {
1310
1310
let hir_id = hir. node_to_hir_id ( k) ;
1311
1311
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) ) ;
1315
1313
}
1316
1314
1317
1315
GlobalCtxt {
@@ -2979,9 +2977,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2979
2977
lint:: struct_lint_level ( self . sess , lint, level, src, None , msg)
2980
2978
}
2981
2979
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 > > {
2983
2981
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 ) )
2985
2983
}
2986
2984
2987
2985
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 {
3054
3052
}
3055
3053
3056
3054
pub 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) ;
3058
3056
providers. module_exports = |tcx, id| tcx. gcx . export_map . get ( & id) . cloned ( ) ;
3059
3057
providers. crate_name = |tcx, id| {
3060
3058
assert_eq ! ( id, LOCAL_CRATE ) ;
0 commit comments