]> git.lizzy.rs Git - rust.git/commitdiff
rename RegionVarBindings to RegionConstraintCollector
authorNiko Matsakis <niko@alum.mit.edu>
Sun, 5 Nov 2017 12:01:48 +0000 (07:01 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 16 Nov 2017 10:57:43 +0000 (05:57 -0500)
src/librustc/infer/lexical_region_resolve/graphviz.rs
src/librustc/infer/lexical_region_resolve/mod.rs
src/librustc/infer/mod.rs
src/librustc/infer/region_constraints/mod.rs

index baf7f0aac3dff3fc95ec9118c8f70f4bd1fee578..880c0e22947441d3e6c9241740dcc338e5b6cfb7 100644 (file)
@@ -25,7 +25,7 @@
 use middle::region;
 use super::Constraint;
 use infer::SubregionOrigin;
-use infer::region_constraints::RegionVarBindings;
+use infer::region_constraints::RegionConstraintCollector;
 use util::nodemap::{FxHashMap, FxHashSet};
 
 use std::borrow::Cow;
@@ -57,7 +57,7 @@ fn print_help_message() {
 }
 
 pub fn maybe_print_constraints_for<'a, 'gcx, 'tcx>(
-    region_vars: &RegionVarBindings<'tcx>,
+    region_constraints: &RegionConstraintCollector<'tcx>,
     region_rels: &RegionRelations<'a, 'gcx, 'tcx>)
 {
     let tcx = region_rels.tcx;
@@ -113,7 +113,7 @@ pub fn maybe_print_constraints_for<'a, 'gcx, 'tcx>(
         }
     };
 
-    match dump_region_constraints_to(region_rels, &region_vars.constraints, &output_path) {
+    match dump_region_constraints_to(region_rels, &region_constraints.constraints, &output_path) {
         Ok(()) => {}
         Err(e) => {
             let msg = format!("io error dumping region constraints: {}", e);
index aeeacfb132a650951bba86409650351e371243e2..9a02b274b5fb0654a3776fb4aae73ac7c8052d73 100644 (file)
@@ -14,7 +14,7 @@
 use infer::RegionVariableOrigin;
 use infer::region_constraints::Constraint;
 use infer::region_constraints::GenericKind;
-use infer::region_constraints::RegionVarBindings;
+use infer::region_constraints::RegionConstraintCollector;
 use infer::region_constraints::VerifyBound;
 use middle::free_region::RegionRelations;
 use rustc_data_structures::fx::FxHashSet;
@@ -73,7 +73,7 @@ struct RegionAndOrigin<'tcx> {
 
 type RegionGraph<'tcx> = graph::Graph<(), Constraint<'tcx>>;
 
-impl<'tcx> RegionVarBindings<'tcx> {
+impl<'tcx> RegionConstraintCollector<'tcx> {
     /// This function performs the actual region resolution.  It must be
     /// called after all constraints have been added.  It performs a
     /// fixed-point iteration to find region values which satisfy all
@@ -86,7 +86,7 @@ pub fn resolve_regions(
         LexicalRegionResolutions<'tcx>,
         Vec<RegionResolutionError<'tcx>>,
     ) {
-        debug!("RegionVarBindings: resolve_regions()");
+        debug!("RegionConstraintCollector: resolve_regions()");
         let mut errors = vec![];
         let values = self.infer_variable_values(region_rels, &mut errors);
         (values, errors)
@@ -642,7 +642,7 @@ struct WalkState<'tcx> {
         return (result, dup_found);
 
         fn process_edges<'tcx>(
-            this: &RegionVarBindings<'tcx>,
+            this: &RegionConstraintCollector<'tcx>,
             state: &mut WalkState<'tcx>,
             graph: &RegionGraph<'tcx>,
             source_vid: RegionVid,
index fe15f9acdb5a0b51dc949f1addf8f5d8e9a76c9d..d42419d7dc64d487df152d93d34bec2c5d268185 100644 (file)
@@ -41,7 +41,7 @@
 
 use self::combine::CombineFields;
 use self::higher_ranked::HrMatchResult;
-use self::region_constraints::{RegionVarBindings, RegionSnapshot};
+use self::region_constraints::{RegionConstraintCollector, RegionSnapshot};
 use self::lexical_region_resolve::LexicalRegionResolutions;
 use self::type_variable::TypeVariableOrigin;
 use self::unify_key::ToType;
@@ -104,7 +104,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
     float_unification_table: RefCell<UnificationTable<ty::FloatVid>>,
 
     // For region variables.
-    region_constraints: RefCell<RegionVarBindings<'tcx>>,
+    region_constraints: RefCell<RegionConstraintCollector<'tcx>>,
 
     // Once region inference is done, the values for each variable.
     lexical_region_resolutions: RefCell<Option<LexicalRegionResolutions<'tcx>>>,
@@ -424,7 +424,7 @@ pub fn enter<F, R>(&'tcx mut self, f: F) -> R
             type_variables: RefCell::new(type_variable::TypeVariableTable::new()),
             int_unification_table: RefCell::new(UnificationTable::new()),
             float_unification_table: RefCell::new(UnificationTable::new()),
-            region_constraints: RefCell::new(RegionVarBindings::new()),
+            region_constraints: RefCell::new(RegionConstraintCollector::new()),
             lexical_region_resolutions: RefCell::new(None),
             selection_cache: traits::SelectionCache::new(),
             evaluation_cache: traits::EvaluationCache::new(),
index 0731a2cfed6c92ac20704b190087631928ee7d15..446acac4fd184f1e39d829d1aebb64de28b1c057 100644 (file)
@@ -143,7 +143,7 @@ enum CombineMapType {
 
 type CombineMap<'tcx> = FxHashMap<TwoRegions<'tcx>, RegionVid>;
 
-pub struct RegionVarBindings<'tcx> {
+pub struct RegionConstraintCollector<'tcx> {
     pub(in infer) var_origins: Vec<RegionVariableOrigin>,
 
     /// Constraints of the form `A <= B` introduced by the region
@@ -242,9 +242,9 @@ pub fn both() -> Self {
     }
 }
 
-impl<'tcx> RegionVarBindings<'tcx> {
-    pub fn new() -> RegionVarBindings<'tcx> {
-        RegionVarBindings {
+impl<'tcx> RegionConstraintCollector<'tcx> {
+    pub fn new() -> RegionConstraintCollector<'tcx> {
+        RegionConstraintCollector {
             var_origins: Vec::new(),
             constraints: BTreeMap::new(),
             verifys: Vec::new(),
@@ -264,7 +264,7 @@ fn in_snapshot(&self) -> bool {
 
     pub fn start_snapshot(&mut self) -> RegionSnapshot {
         let length = self.undo_log.len();
-        debug!("RegionVarBindings: start_snapshot({})", length);
+        debug!("RegionConstraintCollector: start_snapshot({})", length);
         self.undo_log.push(OpenSnapshot);
         RegionSnapshot {
             length,
@@ -274,7 +274,7 @@ pub fn start_snapshot(&mut self) -> RegionSnapshot {
     }
 
     pub fn commit(&mut self, snapshot: RegionSnapshot) {
-        debug!("RegionVarBindings: commit({})", snapshot.length);
+        debug!("RegionConstraintCollector: commit({})", snapshot.length);
         assert!(self.undo_log.len() > snapshot.length);
         assert!(self.undo_log[snapshot.length] == OpenSnapshot);
         assert!(
@@ -294,7 +294,7 @@ pub fn commit(&mut self, snapshot: RegionSnapshot) {
     }
 
     pub fn rollback_to(&mut self, snapshot: RegionSnapshot) {
-        debug!("RegionVarBindings: rollback_to({:?})", snapshot);
+        debug!("RegionConstraintCollector: rollback_to({:?})", snapshot);
         assert!(self.undo_log.len() > snapshot.length);
         assert!(self.undo_log[snapshot.length] == OpenSnapshot);
         while self.undo_log.len() > snapshot.length + 1 {
@@ -523,7 +523,7 @@ pub fn new_bound(
 
     fn add_constraint(&mut self, constraint: Constraint<'tcx>, origin: SubregionOrigin<'tcx>) {
         // cannot add constraints once regions are resolved
-        debug!("RegionVarBindings: add_constraint({:?})", constraint);
+        debug!("RegionConstraintCollector: add_constraint({:?})", constraint);
 
         // never overwrite an existing (constraint, origin) - only insert one if it isn't
         // present in the map yet. This prevents origins from outside the snapshot being
@@ -542,7 +542,7 @@ fn add_constraint(&mut self, constraint: Constraint<'tcx>, origin: SubregionOrig
 
     fn add_verify(&mut self, verify: Verify<'tcx>) {
         // cannot add verifys once regions are resolved
-        debug!("RegionVarBindings: add_verify({:?})", verify);
+        debug!("RegionConstraintCollector: add_verify({:?})", verify);
 
         // skip no-op cases known to be satisfied
         match verify.bound {
@@ -594,7 +594,7 @@ pub fn make_subregion(
     ) {
         // cannot add constraints once regions are resolved
         debug!(
-            "RegionVarBindings: make_subregion({:?}, {:?}) due to {:?}",
+            "RegionConstraintCollector: make_subregion({:?}, {:?}) due to {:?}",
             sub,
             sup,
             origin
@@ -651,7 +651,7 @@ pub fn lub_regions(
         b: Region<'tcx>,
     ) -> Region<'tcx> {
         // cannot add constraints once regions are resolved
-        debug!("RegionVarBindings: lub_regions({:?}, {:?})", a, b);
+        debug!("RegionConstraintCollector: lub_regions({:?}, {:?})", a, b);
         match (a, b) {
             (r @ &ReStatic, _) | (_, r @ &ReStatic) => {
                 r // nothing lives longer than static
@@ -673,7 +673,7 @@ pub fn glb_regions(
         b: Region<'tcx>,
     ) -> Region<'tcx> {
         // cannot add constraints once regions are resolved
-        debug!("RegionVarBindings: glb_regions({:?}, {:?})", a, b);
+        debug!("RegionConstraintCollector: glb_regions({:?}, {:?})", a, b);
         match (a, b) {
             (&ReStatic, r) | (r, &ReStatic) => {
                 r // static lives longer than everything else