@@ -248,6 +248,11 @@ pub struct TypeckTables<'tcx> {
248
248
/// If any errors occurred while type-checking this body,
249
249
/// this field will be set to `true`.
250
250
pub tainted_by_errors : bool ,
251
+
252
+ /// Stores the free-region relationships that were deduced from
253
+ /// its where clauses and parameter types. These are then
254
+ /// read-again by borrowck.
255
+ pub free_region_map : FreeRegionMap ,
251
256
}
252
257
253
258
impl < ' tcx > TypeckTables < ' tcx > {
@@ -267,6 +272,7 @@ impl<'tcx> TypeckTables<'tcx> {
267
272
lints : lint:: LintTable :: new ( ) ,
268
273
used_trait_imports : DefIdSet ( ) ,
269
274
tainted_by_errors : false ,
275
+ free_region_map : FreeRegionMap :: new ( ) ,
270
276
}
271
277
}
272
278
@@ -414,13 +420,6 @@ pub struct GlobalCtxt<'tcx> {
414
420
415
421
pub region_maps : RegionMaps ,
416
422
417
- // For each fn declared in the local crate, type check stores the
418
- // free-region relationships that were deduced from its where
419
- // clauses and parameter types. These are then read-again by
420
- // borrowck. (They are not used during trans, and hence are not
421
- // serialized or needed for cross-crate fns.)
422
- free_region_maps : RefCell < NodeMap < FreeRegionMap > > ,
423
-
424
423
pub hir : hir_map:: Map < ' tcx > ,
425
424
pub maps : maps:: Maps < ' tcx > ,
426
425
@@ -645,16 +644,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
645
644
interned
646
645
}
647
646
648
- pub fn store_free_region_map ( self , id : NodeId , map : FreeRegionMap ) {
649
- if self . free_region_maps . borrow_mut ( ) . insert ( id, map) . is_some ( ) {
650
- bug ! ( "Tried to overwrite interned FreeRegionMap for NodeId {:?}" , id)
651
- }
652
- }
653
-
654
- pub fn free_region_map ( self , id : NodeId ) -> FreeRegionMap {
655
- self . free_region_maps . borrow ( ) [ & id] . clone ( )
656
- }
657
-
658
647
pub fn lift < T : ?Sized + Lift < ' tcx > > ( self , value : & T ) -> Option < T :: Lifted > {
659
648
value. lift_to_tcx ( self )
660
649
}
@@ -707,7 +696,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
707
696
types : common_types,
708
697
named_region_map : named_region_map,
709
698
region_maps : region_maps,
710
- free_region_maps : RefCell :: new ( FxHashMap ( ) ) ,
711
699
variance_computed : Cell :: new ( false ) ,
712
700
trait_map : resolutions. trait_map ,
713
701
fulfilled_predicates : RefCell :: new ( fulfilled_predicates) ,
0 commit comments