Skip to content

Commit 43ad4c2

Browse files
committed
rename RegionVarBindings to RegionConstraintCollector
1 parent 8c52c9e commit 43ad4c2

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/librustc/infer/lexical_region_resolve/graphviz.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use middle::free_region::RegionRelations;
2525
use middle::region;
2626
use super::Constraint;
2727
use infer::SubregionOrigin;
28-
use infer::region_constraints::RegionVarBindings;
28+
use infer::region_constraints::RegionConstraintCollector;
2929
use util::nodemap::{FxHashMap, FxHashSet};
3030

3131
use std::borrow::Cow;
@@ -57,7 +57,7 @@ graphs will be printed. \n\
5757
}
5858

5959
pub fn maybe_print_constraints_for<'a, 'gcx, 'tcx>(
60-
region_vars: &RegionVarBindings<'tcx>,
60+
region_constraints: &RegionConstraintCollector<'tcx>,
6161
region_rels: &RegionRelations<'a, 'gcx, 'tcx>)
6262
{
6363
let tcx = region_rels.tcx;
@@ -113,7 +113,7 @@ pub fn maybe_print_constraints_for<'a, 'gcx, 'tcx>(
113113
}
114114
};
115115

116-
match dump_region_constraints_to(region_rels, &region_vars.constraints, &output_path) {
116+
match dump_region_constraints_to(region_rels, &region_constraints.constraints, &output_path) {
117117
Ok(()) => {}
118118
Err(e) => {
119119
let msg = format!("io error dumping region constraints: {}", e);

src/librustc/infer/lexical_region_resolve/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use infer::SubregionOrigin;
1414
use infer::RegionVariableOrigin;
1515
use infer::region_constraints::Constraint;
1616
use infer::region_constraints::GenericKind;
17-
use infer::region_constraints::RegionVarBindings;
17+
use infer::region_constraints::RegionConstraintCollector;
1818
use infer::region_constraints::VerifyBound;
1919
use middle::free_region::RegionRelations;
2020
use rustc_data_structures::fx::FxHashSet;
@@ -73,7 +73,7 @@ struct RegionAndOrigin<'tcx> {
7373

7474
type RegionGraph<'tcx> = graph::Graph<(), Constraint<'tcx>>;
7575

76-
impl<'tcx> RegionVarBindings<'tcx> {
76+
impl<'tcx> RegionConstraintCollector<'tcx> {
7777
/// This function performs the actual region resolution. It must be
7878
/// called after all constraints have been added. It performs a
7979
/// fixed-point iteration to find region values which satisfy all
@@ -86,7 +86,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
8686
LexicalRegionResolutions<'tcx>,
8787
Vec<RegionResolutionError<'tcx>>,
8888
) {
89-
debug!("RegionVarBindings: resolve_regions()");
89+
debug!("RegionConstraintCollector: resolve_regions()");
9090
let mut errors = vec![];
9191
let values = self.infer_variable_values(region_rels, &mut errors);
9292
(values, errors)
@@ -642,7 +642,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
642642
return (result, dup_found);
643643

644644
fn process_edges<'tcx>(
645-
this: &RegionVarBindings<'tcx>,
645+
this: &RegionConstraintCollector<'tcx>,
646646
state: &mut WalkState<'tcx>,
647647
graph: &RegionGraph<'tcx>,
648648
source_vid: RegionVid,

src/librustc/infer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use arena::DroplessArena;
4141

4242
use self::combine::CombineFields;
4343
use self::higher_ranked::HrMatchResult;
44-
use self::region_constraints::{RegionVarBindings, RegionSnapshot};
44+
use self::region_constraints::{RegionConstraintCollector, RegionSnapshot};
4545
use self::lexical_region_resolve::LexicalRegionResolutions;
4646
use self::type_variable::TypeVariableOrigin;
4747
use self::unify_key::ToType;
@@ -104,7 +104,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
104104
float_unification_table: RefCell<UnificationTable<ty::FloatVid>>,
105105

106106
// For region variables.
107-
region_constraints: RefCell<RegionVarBindings<'tcx>>,
107+
region_constraints: RefCell<RegionConstraintCollector<'tcx>>,
108108

109109
// Once region inference is done, the values for each variable.
110110
lexical_region_resolutions: RefCell<Option<LexicalRegionResolutions<'tcx>>>,
@@ -424,7 +424,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
424424
type_variables: RefCell::new(type_variable::TypeVariableTable::new()),
425425
int_unification_table: RefCell::new(UnificationTable::new()),
426426
float_unification_table: RefCell::new(UnificationTable::new()),
427-
region_constraints: RefCell::new(RegionVarBindings::new()),
427+
region_constraints: RefCell::new(RegionConstraintCollector::new()),
428428
lexical_region_resolutions: RefCell::new(None),
429429
selection_cache: traits::SelectionCache::new(),
430430
evaluation_cache: traits::EvaluationCache::new(),

src/librustc/infer/region_constraints/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ enum CombineMapType {
143143

144144
type CombineMap<'tcx> = FxHashMap<TwoRegions<'tcx>, RegionVid>;
145145

146-
pub struct RegionVarBindings<'tcx> {
146+
pub struct RegionConstraintCollector<'tcx> {
147147
pub(in infer) var_origins: Vec<RegionVariableOrigin>,
148148

149149
/// Constraints of the form `A <= B` introduced by the region
@@ -242,9 +242,9 @@ impl TaintDirections {
242242
}
243243
}
244244

245-
impl<'tcx> RegionVarBindings<'tcx> {
246-
pub fn new() -> RegionVarBindings<'tcx> {
247-
RegionVarBindings {
245+
impl<'tcx> RegionConstraintCollector<'tcx> {
246+
pub fn new() -> RegionConstraintCollector<'tcx> {
247+
RegionConstraintCollector {
248248
var_origins: Vec::new(),
249249
constraints: BTreeMap::new(),
250250
verifys: Vec::new(),
@@ -264,7 +264,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
264264

265265
pub fn start_snapshot(&mut self) -> RegionSnapshot {
266266
let length = self.undo_log.len();
267-
debug!("RegionVarBindings: start_snapshot({})", length);
267+
debug!("RegionConstraintCollector: start_snapshot({})", length);
268268
self.undo_log.push(OpenSnapshot);
269269
RegionSnapshot {
270270
length,
@@ -274,7 +274,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
274274
}
275275

276276
pub fn commit(&mut self, snapshot: RegionSnapshot) {
277-
debug!("RegionVarBindings: commit({})", snapshot.length);
277+
debug!("RegionConstraintCollector: commit({})", snapshot.length);
278278
assert!(self.undo_log.len() > snapshot.length);
279279
assert!(self.undo_log[snapshot.length] == OpenSnapshot);
280280
assert!(
@@ -294,7 +294,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
294294
}
295295

296296
pub fn rollback_to(&mut self, snapshot: RegionSnapshot) {
297-
debug!("RegionVarBindings: rollback_to({:?})", snapshot);
297+
debug!("RegionConstraintCollector: rollback_to({:?})", snapshot);
298298
assert!(self.undo_log.len() > snapshot.length);
299299
assert!(self.undo_log[snapshot.length] == OpenSnapshot);
300300
while self.undo_log.len() > snapshot.length + 1 {
@@ -523,7 +523,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
523523

524524
fn add_constraint(&mut self, constraint: Constraint<'tcx>, origin: SubregionOrigin<'tcx>) {
525525
// cannot add constraints once regions are resolved
526-
debug!("RegionVarBindings: add_constraint({:?})", constraint);
526+
debug!("RegionConstraintCollector: add_constraint({:?})", constraint);
527527

528528
// never overwrite an existing (constraint, origin) - only insert one if it isn't
529529
// present in the map yet. This prevents origins from outside the snapshot being
@@ -542,7 +542,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
542542

543543
fn add_verify(&mut self, verify: Verify<'tcx>) {
544544
// cannot add verifys once regions are resolved
545-
debug!("RegionVarBindings: add_verify({:?})", verify);
545+
debug!("RegionConstraintCollector: add_verify({:?})", verify);
546546

547547
// skip no-op cases known to be satisfied
548548
match verify.bound {
@@ -594,7 +594,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
594594
) {
595595
// cannot add constraints once regions are resolved
596596
debug!(
597-
"RegionVarBindings: make_subregion({:?}, {:?}) due to {:?}",
597+
"RegionConstraintCollector: make_subregion({:?}, {:?}) due to {:?}",
598598
sub,
599599
sup,
600600
origin
@@ -651,7 +651,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
651651
b: Region<'tcx>,
652652
) -> Region<'tcx> {
653653
// cannot add constraints once regions are resolved
654-
debug!("RegionVarBindings: lub_regions({:?}, {:?})", a, b);
654+
debug!("RegionConstraintCollector: lub_regions({:?}, {:?})", a, b);
655655
match (a, b) {
656656
(r @ &ReStatic, _) | (_, r @ &ReStatic) => {
657657
r // nothing lives longer than static
@@ -673,7 +673,7 @@ impl<'tcx> RegionVarBindings<'tcx> {
673673
b: Region<'tcx>,
674674
) -> Region<'tcx> {
675675
// cannot add constraints once regions are resolved
676-
debug!("RegionVarBindings: glb_regions({:?}, {:?})", a, b);
676+
debug!("RegionConstraintCollector: glb_regions({:?}, {:?})", a, b);
677677
match (a, b) {
678678
(&ReStatic, r) | (r, &ReStatic) => {
679679
r // static lives longer than everything else

0 commit comments

Comments
 (0)