.filter(|&r| r != representative)
{
let origin = SubregionOrigin::Subtype(self.trace.clone());
- self.infcx.region_vars.borrow_mut().make_eqregion(origin,
+ self.infcx.region_constraints.borrow_mut().make_eqregion(origin,
*representative,
*region);
}
fn fresh_bound_variable<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
debruijn: ty::DebruijnIndex)
-> ty::Region<'tcx> {
- infcx.region_vars.borrow_mut().new_bound(infcx.tcx, debruijn)
+ infcx.region_constraints.borrow_mut().new_bound(infcx.tcx, debruijn)
}
}
}
r: ty::Region<'tcx>,
directions: TaintDirections)
-> FxHashSet<ty::Region<'tcx>> {
- self.region_vars.borrow().tainted(self.tcx, &snapshot.region_vars_snapshot, r, directions)
+ self.region_constraints.borrow().tainted(
+ self.tcx,
+ &snapshot.region_constraints_snapshot,
+ r,
+ directions)
}
fn region_vars_confined_to_snapshot(&self,
*/
let mut region_vars =
- self.region_vars.borrow().vars_created_since_snapshot(&snapshot.region_vars_snapshot);
+ self.region_constraints.borrow().vars_created_since_snapshot(
+ &snapshot.region_constraints_snapshot);
let escaping_types =
self.type_variables.borrow_mut().types_escaping_snapshot(&snapshot.type_snapshot);
where T : TypeFoldable<'tcx>
{
let (result, map) = self.tcx.replace_late_bound_regions(binder, |br| {
- self.region_vars.borrow_mut().push_skolemized(self.tcx,
+ self.region_constraints.borrow_mut().push_skolemized(self.tcx,
br,
- &snapshot.region_vars_snapshot)
+ &snapshot.region_constraints_snapshot)
});
debug!("skolemize_bound_regions(binder={:?}, result={:?}, map={:?})",
{
debug!("pop_skolemized({:?})", skol_map);
let skol_regions: FxHashSet<_> = skol_map.values().cloned().collect();
- self.region_vars.borrow_mut().pop_skolemized(self.tcx,
- &skol_regions,
- &snapshot.region_vars_snapshot);
+ self.region_constraints.borrow_mut().pop_skolemized(
+ self.tcx,
+ &skol_regions,
+ &snapshot.region_constraints_snapshot);
if !skol_map.is_empty() {
self.projection_cache.borrow_mut().rollback_skolemized(
&snapshot.projection_cache_snapshot);
float_unification_table: RefCell<UnificationTable<ty::FloatVid>>,
// For region variables.
- region_constraints: RefCell<RegionConstraints<'tcx>>,
+ region_constraints: RefCell<RegionVarBindings<'tcx>>,
// Once region inference is done, the values for each variable.
lexical_region_resolutions: RefCell<Option<LexicalRegionResolutions<'tcx>>>,
type_variables: RefCell::new(type_variable::TypeVariableTable::new()),
int_unification_table: RefCell::new(UnificationTable::new()),
float_unification_table: RefCell::new(UnificationTable::new()),
- region_vars: RefCell::new(RegionVarBindings::new()),
+ region_constraints: RefCell::new(RegionVarBindings::new()),
lexical_region_resolutions: RefCell::new(None),
selection_cache: traits::SelectionCache::new(),
evaluation_cache: traits::EvaluationCache::new(),
type_snapshot: type_variable::Snapshot,
int_snapshot: unify::Snapshot<ty::IntVid>,
float_snapshot: unify::Snapshot<ty::FloatVid>,
- region_vars_snapshot: RegionSnapshot,
+ region_constraints_snapshot: RegionSnapshot,
was_in_snapshot: bool,
_in_progress_tables: Option<Ref<'a, ty::TypeckTables<'tcx>>>,
}
type_snapshot: self.type_variables.borrow_mut().snapshot(),
int_snapshot: self.int_unification_table.borrow_mut().snapshot(),
float_snapshot: self.float_unification_table.borrow_mut().snapshot(),
- region_vars_snapshot: self.region_vars.borrow_mut().start_snapshot(),
+ region_constraints_snapshot: self.region_constraints.borrow_mut().start_snapshot(),
was_in_snapshot: in_snapshot,
// Borrow tables "in progress" (i.e. during typeck)
// to ban writes from within a snapshot to them.
type_snapshot,
int_snapshot,
float_snapshot,
- region_vars_snapshot,
+ region_constraints_snapshot,
was_in_snapshot,
_in_progress_tables } = snapshot;
self.float_unification_table
.borrow_mut()
.rollback_to(float_snapshot);
- self.region_vars
+ self.region_constraints
.borrow_mut()
- .rollback_to(region_vars_snapshot);
+ .rollback_to(region_constraints_snapshot);
}
fn commit_from(&self, snapshot: CombinedSnapshot) {
type_snapshot,
int_snapshot,
float_snapshot,
- region_vars_snapshot,
+ region_constraints_snapshot,
was_in_snapshot,
_in_progress_tables } = snapshot;
self.float_unification_table
.borrow_mut()
.commit(float_snapshot);
- self.region_vars
+ self.region_constraints
.borrow_mut()
- .commit(region_vars_snapshot);
+ .commit(region_constraints_snapshot);
}
/// Execute `f` and commit the bindings
sub: ty::Region<'tcx>,
sup: ty::RegionVid)
{
- self.region_vars.borrow_mut().add_given(sub, sup);
+ self.region_constraints.borrow_mut().add_given(sub, sup);
}
pub fn can_sub<T>(&self,
a: ty::Region<'tcx>,
b: ty::Region<'tcx>) {
debug!("sub_regions({:?} <: {:?})", a, b);
- self.region_vars.borrow_mut().make_subregion(origin, a, b);
+ self.region_constraints.borrow_mut().make_subregion(origin, a, b);
}
pub fn equality_predicate(&self,
pub fn next_region_var(&self, origin: RegionVariableOrigin)
-> ty::Region<'tcx> {
- self.tcx.mk_region(ty::ReVar(self.region_vars.borrow_mut().new_region_var(origin)))
+ self.tcx.mk_region(ty::ReVar(self.region_constraints.borrow_mut().new_region_var(origin)))
}
/// Create a region inference variable for the given
region_map,
free_regions);
let (lexical_region_resolutions, errors) =
- self.region_vars.borrow_mut().resolve_regions(®ion_rels);
+ self.region_constraints.borrow_mut().resolve_regions(®ion_rels);
let old_value = self.lexical_region_resolutions.replace(Some(lexical_region_resolutions));
assert!(old_value.is_none());
a,
bound);
- self.region_vars.borrow_mut().verify_generic_bound(origin, kind, a, bound);
+ self.region_constraints.borrow_mut().verify_generic_bound(origin, kind, a, bound);
}
pub fn type_moves_by_default(&self,