diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index 9ce0e503280e..67fdd68a826c 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -57,7 +57,7 @@ use infer; use super::{InferCtxt, TypeTrace, SubregionOrigin, RegionVariableOrigin, ValuePairs}; -use super::region_inference::GenericKind; +use super::region_constraints::GenericKind; use super::lexical_region_resolve::RegionResolutionError; use std::fmt; diff --git a/src/librustc/infer/higher_ranked/mod.rs b/src/librustc/infer/higher_ranked/mod.rs index e2a214ed0cbf..5f898856d31f 100644 --- a/src/librustc/infer/higher_ranked/mod.rs +++ b/src/librustc/infer/higher_ranked/mod.rs @@ -17,7 +17,7 @@ use super::{CombinedSnapshot, SubregionOrigin, SkolemizationMap}; use super::combine::CombineFields; -use super::region_inference::{TaintDirections}; +use super::region_constraints::{TaintDirections}; use ty::{self, TyCtxt, Binder, TypeFoldable}; use ty::error::TypeError; diff --git a/src/librustc/infer/lexical_region_resolve/graphviz.rs b/src/librustc/infer/lexical_region_resolve/graphviz.rs index dd775fb5e17c..baf7f0aac3df 100644 --- a/src/librustc/infer/lexical_region_resolve/graphviz.rs +++ b/src/librustc/infer/lexical_region_resolve/graphviz.rs @@ -9,7 +9,7 @@ // except according to those terms. //! This module provides linkage between libgraphviz traits and -//! `rustc::middle::typeck::infer::region_inference`, generating a +//! `rustc::middle::typeck::infer::region_constraints`, generating a //! rendering of the graph represented by the list of `Constraint` //! instances (which make up the edges of the graph), as well as the //! origin for each constraint (which are attached to the labels on @@ -25,7 +25,7 @@ use middle::free_region::RegionRelations; use middle::region; use super::Constraint; use infer::SubregionOrigin; -use infer::region_inference::RegionVarBindings; +use infer::region_constraints::RegionVarBindings; use util::nodemap::{FxHashMap, FxHashSet}; use std::borrow::Cow; diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs index ac3ba57d980c..aeeacfb132a6 100644 --- a/src/librustc/infer/lexical_region_resolve/mod.rs +++ b/src/librustc/infer/lexical_region_resolve/mod.rs @@ -12,10 +12,10 @@ use infer::SubregionOrigin; use infer::RegionVariableOrigin; -use infer::region_inference::Constraint; -use infer::region_inference::GenericKind; -use infer::region_inference::RegionVarBindings; -use infer::region_inference::VerifyBound; +use infer::region_constraints::Constraint; +use infer::region_constraints::GenericKind; +use infer::region_constraints::RegionVarBindings; +use infer::region_constraints::VerifyBound; use middle::free_region::RegionRelations; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::{self, Direction, NodeIndex, OUTGOING}; diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 4aef09aa935a..e5e6f292f687 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -16,7 +16,7 @@ pub use self::SubregionOrigin::*; pub use self::ValuePairs::*; pub use ty::IntVarValue; pub use self::freshen::TypeFreshener; -pub use self::region_inference::{GenericKind, VerifyBound}; +pub use self::region_constraints::{GenericKind, VerifyBound}; use hir::def_id::DefId; use middle::free_region::{FreeRegionMap, RegionRelations}; @@ -41,7 +41,7 @@ use arena::DroplessArena; use self::combine::CombineFields; use self::higher_ranked::HrMatchResult; -use self::region_inference::{RegionVarBindings, RegionSnapshot}; +use self::region_constraints::{RegionVarBindings, RegionSnapshot}; use self::lexical_region_resolve::LexicalRegionResolutions; use self::type_variable::TypeVariableOrigin; use self::unify_key::ToType; @@ -55,7 +55,7 @@ mod glb; mod higher_ranked; pub mod lattice; mod lub; -pub mod region_inference; +pub mod region_constraints; mod lexical_region_resolve; mod outlives; pub mod resolve; @@ -104,7 +104,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { float_unification_table: RefCell>, // For region variables. - region_vars: RefCell>, + region_constraints: RefCell>, // Once region inference is done, the values for each variable. lexical_region_resolutions: RefCell>>, @@ -1354,7 +1354,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { Ok(InferOk { value: result, obligations: combine.obligations }) } - /// See `verify_generic_bound` method in `region_inference` + /// See `verify_generic_bound` method in `region_constraints` pub fn verify_generic_bound(&self, origin: SubregionOrigin<'tcx>, kind: GenericKind<'tcx>, diff --git a/src/librustc/infer/region_inference/README.md b/src/librustc/infer/region_constraints/README.md similarity index 100% rename from src/librustc/infer/region_inference/README.md rename to src/librustc/infer/region_constraints/README.md diff --git a/src/librustc/infer/region_inference/mod.rs b/src/librustc/infer/region_constraints/mod.rs similarity index 100% rename from src/librustc/infer/region_inference/mod.rs rename to src/librustc/infer/region_constraints/mod.rs diff --git a/src/librustc/infer/region_inference/taint.rs b/src/librustc/infer/region_constraints/taint.rs similarity index 100% rename from src/librustc/infer/region_inference/taint.rs rename to src/librustc/infer/region_constraints/taint.rs diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index a7882992d61c..d3aa80e5585e 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -12,7 +12,7 @@ //! the parent links in the region hierarchy. //! //! Most of the documentation on regions can be found in -//! `middle/infer/region_inference/README.md` +//! `middle/infer/region_constraints/README.md` use ich::{StableHashingContext, NodeIdHashingMode}; use util::nodemap::{FxHashMap, FxHashSet}; @@ -320,7 +320,7 @@ pub struct ScopeTree { /// hierarchy based on their lexical mapping. This is used to /// handle the relationships between regions in a fn and in a /// closure defined by that fn. See the "Modeling closures" - /// section of the README in infer::region_inference for + /// section of the README in infer::region_constraints for /// more details. closure_tree: FxHashMap, @@ -407,7 +407,7 @@ pub struct Context { /// of the innermost fn body. Each fn forms its own disjoint tree /// in the region hierarchy. These fn bodies are themselves /// arranged into a tree. See the "Modeling closures" section of - /// the README in infer::region_inference for more + /// the README in infer::region_constraints for more /// details. root_id: Option, @@ -646,7 +646,7 @@ impl<'tcx> ScopeTree { // different functions. Compare those fn for lexical // nesting. The reasoning behind this is subtle. See the // "Modeling closures" section of the README in - // infer::region_inference for more details. + // infer::region_constraints for more details. let a_root_scope = a_ancestors[a_index]; let b_root_scope = a_ancestors[a_index]; return match (a_root_scope.data(), b_root_scope.data()) { diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 272f13b28030..ea0fa945c378 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -471,7 +471,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { // // 2. Things go horribly wrong if we use subtype. The reason for // THIS is a fairly subtle case involving bound regions. See the - // `givens` field in `region_inference`, as well as the test + // `givens` field in `region_constraints`, as well as the test // `regions-relate-bound-regions-on-closures-to-inference-variables.rs`, // for details. Short version is that we must sometimes detect // relationships between specific region variables and regions diff --git a/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs b/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs index ae4adbfb1f49..3162ef54f39b 100644 --- a/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs +++ b/src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs @@ -42,7 +42,7 @@ impl<'a,'tcx> Foo<'a,'tcx> { // inferring `'_2` to be `'static` in this case, because // it is created outside the closure but then related to // regions bound by the closure itself. See the - // `region_inference.rs` file (and the `givens` field, in + // `region_constraints.rs` file (and the `givens` field, in // particular) for more details. this.foo() }))