Skip to content

Commit 5a9ccc9

Browse files
committed
Remove free_region_map from TypeckTables
It was unused.
1 parent 5e9ebf4 commit 5a9ccc9

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
@@ -23,7 +23,6 @@ use crate::mir::{
2323
};
2424
use crate::traits;
2525
use crate::traits::{Clause, Clauses, Goal, GoalKind, Goals};
26-
use crate::ty::free_region_map::FreeRegionMap;
2726
use crate::ty::layout::{LayoutDetails, TargetDataLayout, VariantIdx};
2827
use crate::ty::query;
2928
use crate::ty::steal::Steal;
@@ -416,11 +415,6 @@ pub struct TypeckTables<'tcx> {
416415
/// this field will be set to `true`.
417416
pub tainted_by_errors: bool,
418417

419-
/// Stores the free-region relationships that were deduced from
420-
/// its where-clauses and parameter types. These are then
421-
/// read-again by borrowck.
422-
pub free_region_map: FreeRegionMap<'tcx>,
423-
424418
/// All the opaque types that are restricted to concrete types
425419
/// by this function.
426420
pub concrete_opaque_types: FxHashMap<DefId, ResolvedOpaqueTy<'tcx>>,
@@ -456,7 +450,6 @@ impl<'tcx> TypeckTables<'tcx> {
456450
coercion_casts: Default::default(),
457451
used_trait_imports: Lrc::new(Default::default()),
458452
tainted_by_errors: false,
459-
free_region_map: Default::default(),
460453
concrete_opaque_types: Default::default(),
461454
upvar_list: Default::default(),
462455
generator_interior_types: Default::default(),
@@ -719,7 +712,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckTables<'tcx> {
719712

720713
ref used_trait_imports,
721714
tainted_by_errors,
722-
ref free_region_map,
723715
ref concrete_opaque_types,
724716
ref upvar_list,
725717
ref generator_interior_types,
@@ -757,7 +749,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckTables<'tcx> {
757749
coercion_casts.hash_stable(hcx, hasher);
758750
used_trait_imports.hash_stable(hcx, hasher);
759751
tainted_by_errors.hash_stable(hcx, hasher);
760-
free_region_map.hash_stable(hcx, hasher);
761752
concrete_opaque_types.hash_stable(hcx, hasher);
762753
upvar_list.hash_stable(hcx, hasher);
763754
generator_interior_types.hash_stable(hcx, hasher);

src/librustc_typeck/check/regionck.rs

-9
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
125125
rcx.visit_region_obligations(id);
126126
}
127127
rcx.resolve_regions_and_report_errors(SuppressRegionErrors::when_nll_is_enabled(self.tcx));
128-
129-
assert!(self.tables.borrow().free_region_map.is_empty());
130-
self.tables.borrow_mut().free_region_map = rcx.outlives_environment.into_free_region_map();
131128
}
132129

133130
/// Region checking during the WF phase for items. `wf_tys` are the
@@ -169,12 +166,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
169166
}
170167

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

src/librustc_typeck/check/writeback.rs

-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
6262
wbcx.visit_fru_field_types();
6363
wbcx.visit_opaque_types(body.value.span);
6464
wbcx.visit_coercion_casts();
65-
wbcx.visit_free_region_map();
6665
wbcx.visit_user_provided_tys();
6766
wbcx.visit_user_provided_sigs();
6867
wbcx.visit_generator_interior_types();
@@ -358,11 +357,6 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
358357
}
359358
}
360359

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

0 commit comments

Comments
 (0)