Skip to content

Commit f29afc1

Browse files
committed
Remove free_region_map from TypeckTables
It was unused.
1 parent 3dbade6 commit f29afc1

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

src/librustc/ty/context.rs

-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use crate::mir::{
2222
};
2323
use crate::traits;
2424
use crate::traits::{Clause, Clauses, Goal, GoalKind, Goals};
25-
use crate::ty::free_region_map::FreeRegionMap;
2625
use crate::ty::layout::{LayoutDetails, TargetDataLayout, VariantIdx};
2726
use crate::ty::query;
2827
use crate::ty::steal::Steal;
@@ -415,11 +414,6 @@ pub struct TypeckTables<'tcx> {
415414
/// this field will be set to `true`.
416415
pub tainted_by_errors: bool,
417416

418-
/// Stores the free-region relationships that were deduced from
419-
/// its where-clauses and parameter types. These are then
420-
/// read-again by borrowck.
421-
pub free_region_map: FreeRegionMap<'tcx>,
422-
423417
/// All the opaque types that are restricted to concrete types
424418
/// by this function.
425419
pub concrete_opaque_types: FxHashMap<DefId, ResolvedOpaqueTy<'tcx>>,
@@ -455,7 +449,6 @@ impl<'tcx> TypeckTables<'tcx> {
455449
coercion_casts: Default::default(),
456450
used_trait_imports: Lrc::new(Default::default()),
457451
tainted_by_errors: false,
458-
free_region_map: Default::default(),
459452
concrete_opaque_types: Default::default(),
460453
upvar_list: Default::default(),
461454
generator_interior_types: Default::default(),
@@ -718,7 +711,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckTables<'tcx> {
718711

719712
ref used_trait_imports,
720713
tainted_by_errors,
721-
ref free_region_map,
722714
ref concrete_opaque_types,
723715
ref upvar_list,
724716
ref generator_interior_types,
@@ -756,7 +748,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckTables<'tcx> {
756748
coercion_casts.hash_stable(hcx, hasher);
757749
used_trait_imports.hash_stable(hcx, hasher);
758750
tainted_by_errors.hash_stable(hcx, hasher);
759-
free_region_map.hash_stable(hcx, hasher);
760751
concrete_opaque_types.hash_stable(hcx, hasher);
761752
upvar_list.hash_stable(hcx, hasher);
762753
generator_interior_types.hash_stable(hcx, hasher);

src/librustc_typeck/check/regionck.rs

-9
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
123123
rcx.visit_region_obligations(id);
124124
}
125125
rcx.resolve_regions_and_report_errors(SuppressRegionErrors::when_nll_is_enabled(self.tcx));
126-
127-
assert!(self.tables.borrow().free_region_map.is_empty());
128-
self.tables.borrow_mut().free_region_map = rcx.outlives_environment.into_free_region_map();
129126
}
130127

131128
/// Region checking during the WF phase for items. `wf_tys` are the
@@ -167,12 +164,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
167164
}
168165

169166
rcx.resolve_regions_and_report_errors(SuppressRegionErrors::when_nll_is_enabled(self.tcx));
170-
171-
// In this mode, we also copy the free-region-map into the
172-
// tables of the enclosing fcx. In the other regionck modes
173-
// (e.g., `regionck_item`), we don't have an enclosing tables.
174-
assert!(self.tables.borrow().free_region_map.is_empty());
175-
self.tables.borrow_mut().free_region_map = rcx.outlives_environment.into_free_region_map();
176167
}
177168
}
178169

src/librustc_typeck/check/writeback.rs

-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
6161
wbcx.visit_fru_field_types();
6262
wbcx.visit_opaque_types(body.value.span);
6363
wbcx.visit_coercion_casts();
64-
wbcx.visit_free_region_map();
6564
wbcx.visit_user_provided_tys();
6665
wbcx.visit_user_provided_sigs();
6766
wbcx.visit_generator_interior_types();
@@ -357,11 +356,6 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
357356
}
358357
}
359358

360-
fn visit_free_region_map(&mut self) {
361-
self.tables.free_region_map = self.fcx.tables.borrow().free_region_map.clone();
362-
debug_assert!(!self.tables.free_region_map.elements().any(|r| r.has_local_value()));
363-
}
364-
365359
fn visit_user_provided_tys(&mut self) {
366360
let fcx_tables = self.fcx.tables.borrow();
367361
debug_assert_eq!(fcx_tables.local_id_root, self.tables.local_id_root);

0 commit comments

Comments
 (0)