Move infer out of middle::typeck and into just middle.

This commit is contained in:
Niko Matsakis 2014-11-25 16:59:02 -05:00
parent 7c44561ad6
commit db75f8aa91
45 changed files with 126 additions and 120 deletions

View File

@ -79,6 +79,7 @@ pub mod middle {
pub mod fast_reject; pub mod fast_reject;
pub mod graph; pub mod graph;
pub mod intrinsicck; pub mod intrinsicck;
pub mod infer;
pub mod lang_items; pub mod lang_items;
pub mod liveness; pub mod liveness;
pub mod mem_categorization; pub mod mem_categorization;

View File

@ -28,9 +28,9 @@ use self::MethodContext::*;
use metadata::csearch; use metadata::csearch;
use middle::def::*; use middle::def::*;
use middle::infer;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::astconv::ast_ty_to_ty; use middle::typeck::astconv::ast_ty_to_ty;
use middle::typeck::infer;
use middle::{def, pat_util, stability}; use middle::{def, pat_util, stability};
use middle::const_eval::{eval_const_expr_partial, const_int, const_uint}; use middle::const_eval::{eval_const_expr_partial, const_int, const_uint};
use util::ppaux::{ty_to_string}; use util::ppaux::{ty_to_string};

View File

@ -25,11 +25,11 @@
//! for all lint attributes. //! for all lint attributes.
use self::TargetLint::*; use self::TargetLint::*;
use middle::infer;
use middle::privacy::ExportedItems; use middle::privacy::ExportedItems;
use middle::subst; use middle::subst;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::astconv::AstConv; use middle::typeck::astconv::AstConv;
use middle::typeck::infer;
use session::{early_error, Session}; use session::{early_error, Session};
use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject}; use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject};
use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid}; use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid};

View File

@ -27,7 +27,7 @@ use self::Mode::*;
use middle::ty; use middle::ty;
use middle::def; use middle::def;
use middle::typeck; use middle::infer;
use middle::traits; use middle::traits;
use middle::mem_categorization as mc; use middle::mem_categorization as mc;
use middle::expr_use_visitor as euv; use middle::expr_use_visitor as euv;
@ -113,7 +113,7 @@ impl<'a, 'tcx> CheckStaticVisitor<'a, 'tcx> {
fn check_static_type(&self, e: &ast::Expr) { fn check_static_type(&self, e: &ast::Expr) {
let ty = ty::node_id_to_type(self.tcx, e.id); let ty = ty::node_id_to_type(self.tcx, e.id);
let infcx = typeck::infer::new_infer_ctxt(self.tcx); let infcx = infer::new_infer_ctxt(self.tcx);
let mut fulfill_cx = traits::FulfillmentContext::new(); let mut fulfill_cx = traits::FulfillmentContext::new();
let cause = traits::ObligationCause::misc(DUMMY_SP); let cause = traits::ObligationCause::misc(DUMMY_SP);
let obligation = traits::obligation_for_builtin_bound(self.tcx, cause, ty, let obligation = traits::obligation_for_builtin_bound(self.tcx, cause, ty,

View File

@ -60,14 +60,15 @@
//! sort of a minor point so I've opted to leave it for later---after all //! sort of a minor point so I've opted to leave it for later---after all
//! we may want to adjust precisely when coercions occur. //! we may want to adjust precisely when coercions occur.
use super::{CoerceResult, resolve_type, Coercion};
use super::combine::{CombineFields, Combine};
use super::sub::Sub;
use super::resolve::try_resolve_tvar_shallow;
use middle::subst; use middle::subst;
use middle::ty::{AutoPtr, AutoDerefRef, AdjustDerefRef, AutoUnsize, AutoUnsafe}; use middle::ty::{AutoPtr, AutoDerefRef, AdjustDerefRef, AutoUnsize, AutoUnsafe};
use middle::ty::{mt}; use middle::ty::{mt};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::{CoerceResult, resolve_type, Coercion};
use middle::typeck::infer::combine::{CombineFields, Combine};
use middle::typeck::infer::sub::Sub;
use middle::typeck::infer::resolve::try_resolve_tvar_shallow;
use util::ppaux; use util::ppaux;
use util::ppaux::Repr; use util::ppaux::Repr;

View File

@ -32,6 +32,14 @@
// is also useful to track which value is the "expected" value in // is also useful to track which value is the "expected" value in
// terms of error reporting. // terms of error reporting.
use super::equate::Equate;
use super::glb::Glb;
use super::lub::Lub;
use super::sub::Sub;
use super::unify::InferCtxtMethodsForSimplyUnifiableTypes;
use super::{InferCtxt, cres};
use super::{MiscVariable, TypeTrace};
use super::type_variable::{RelationDir, EqTo, SubtypeOf, SupertypeOf};
use middle::subst; use middle::subst;
use middle::subst::{ErasedRegions, NonerasedRegions, Substs}; use middle::subst::{ErasedRegions, NonerasedRegions, Substs};
@ -40,15 +48,6 @@ use middle::ty::{IntType, UintType};
use middle::ty::{BuiltinBounds}; use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::ty_fold; use middle::ty_fold;
use middle::typeck::infer::equate::Equate;
use middle::typeck::infer::glb::Glb;
use middle::typeck::infer::lub::Lub;
use middle::typeck::infer::sub::Sub;
use middle::typeck::infer::unify::InferCtxtMethodsForSimplyUnifiableTypes;
use middle::typeck::infer::{InferCtxt, cres};
use middle::typeck::infer::{MiscVariable, TypeTrace};
use middle::typeck::infer::type_variable::{RelationDir, EqTo,
SubtypeOf, SupertypeOf};
use middle::ty_fold::{TypeFoldable}; use middle::ty_fold::{TypeFoldable};
use util::ppaux::Repr; use util::ppaux::Repr;

View File

@ -11,14 +11,14 @@
use middle::ty::{BuiltinBounds}; use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::ty::TyVar; use middle::ty::TyVar;
use middle::typeck::infer::combine::*; use middle::infer::combine::*;
use middle::typeck::infer::{cres}; use middle::infer::{cres};
use middle::typeck::infer::glb::Glb; use middle::infer::glb::Glb;
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use middle::typeck::infer::lub::Lub; use middle::infer::lub::Lub;
use middle::typeck::infer::sub::Sub; use middle::infer::sub::Sub;
use middle::typeck::infer::{TypeTrace, Subtype}; use middle::infer::{TypeTrace, Subtype};
use middle::typeck::infer::type_variable::{EqTo}; use middle::infer::type_variable::{EqTo};
use util::ppaux::{Repr}; use util::ppaux::{Repr};
use syntax::ast::{Onceness, FnStyle}; use syntax::ast::{Onceness, FnStyle};

View File

@ -57,24 +57,25 @@
use self::FreshOrKept::*; use self::FreshOrKept::*;
use super::InferCtxt;
use super::TypeTrace;
use super::SubregionOrigin;
use super::RegionVariableOrigin;
use super::ValuePairs;
use super::region_inference::RegionResolutionError;
use super::region_inference::ConcreteFailure;
use super::region_inference::SubSupConflict;
use super::region_inference::SupSupConflict;
use super::region_inference::ParamBoundFailure;
use super::region_inference::ProcessedErrors;
use super::region_inference::SameRegions;
use std::collections::HashSet; use std::collections::HashSet;
use middle::def; use middle::def;
use middle::infer;
use middle::subst; use middle::subst;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::ty::{Region, ReFree}; use middle::ty::{Region, ReFree};
use middle::typeck::infer;
use middle::typeck::infer::InferCtxt;
use middle::typeck::infer::TypeTrace;
use middle::typeck::infer::SubregionOrigin;
use middle::typeck::infer::RegionVariableOrigin;
use middle::typeck::infer::ValuePairs;
use middle::typeck::infer::region_inference::RegionResolutionError;
use middle::typeck::infer::region_inference::ConcreteFailure;
use middle::typeck::infer::region_inference::SubSupConflict;
use middle::typeck::infer::region_inference::SupSupConflict;
use middle::typeck::infer::region_inference::ParamBoundFailure;
use middle::typeck::infer::region_inference::ProcessedErrors;
use middle::typeck::infer::region_inference::SameRegions;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::char::from_u32; use std::char::from_u32;
use std::rc::Rc; use std::rc::Rc;

View File

@ -8,17 +8,17 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use super::combine::*;
use super::lattice::*;
use super::equate::Equate;
use super::higher_ranked::HigherRankedRelations;
use super::lub::Lub;
use super::sub::Sub;
use super::{cres, InferCtxt};
use super::{TypeTrace, Subtype};
use middle::ty::{BuiltinBounds}; use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::combine::*;
use middle::typeck::infer::lattice::*;
use middle::typeck::infer::equate::Equate;
use middle::typeck::infer::higher_ranked::HigherRankedRelations;
use middle::typeck::infer::lub::Lub;
use middle::typeck::infer::sub::Sub;
use middle::typeck::infer::{cres, InferCtxt};
use middle::typeck::infer::{TypeTrace, Subtype};
use syntax::ast::{Many, Once, MutImmutable, MutMutable}; use syntax::ast::{Many, Once, MutImmutable, MutMutable};
use syntax::ast::{NormalFn, UnsafeFn}; use syntax::ast::{NormalFn, UnsafeFn};
use syntax::ast::{Onceness, FnStyle}; use syntax::ast::{Onceness, FnStyle};

View File

@ -11,10 +11,11 @@
//! Helper routines for higher-ranked things. See the `doc` module at //! Helper routines for higher-ranked things. See the `doc` module at
//! the end of the file for details. //! the end of the file for details.
use super::{combine, cres, InferCtxt, HigherRankedType};
use super::combine::Combine;
use super::region_inference::{RegionMark};
use middle::ty::{mod, Ty, replace_late_bound_regions}; use middle::ty::{mod, Ty, replace_late_bound_regions};
use middle::typeck::infer::{mod, combine, cres, InferCtxt};
use middle::typeck::infer::combine::Combine;
use middle::typeck::infer::region_inference::{RegionMark};
use middle::ty_fold::{mod, HigherRankedFoldable, TypeFoldable}; use middle::ty_fold::{mod, HigherRankedFoldable, TypeFoldable};
use syntax::codemap::Span; use syntax::codemap::Span;
use util::nodemap::FnvHashMap; use util::nodemap::FnvHashMap;
@ -62,7 +63,7 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C
let (a_prime, _) = let (a_prime, _) =
self.infcx().replace_late_bound_regions_with_fresh_var( self.infcx().replace_late_bound_regions_with_fresh_var(
self.trace().origin.span(), self.trace().origin.span(),
infer::HigherRankedType, HigherRankedType,
a); a);
// Second, we instantiate each bound region in the supertype with a // Second, we instantiate each bound region in the supertype with a
@ -131,10 +132,10 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C
let span = self.trace().origin.span(); let span = self.trace().origin.span();
let (a_with_fresh, a_map) = let (a_with_fresh, a_map) =
self.infcx().replace_late_bound_regions_with_fresh_var( self.infcx().replace_late_bound_regions_with_fresh_var(
span, infer::HigherRankedType, a); span, HigherRankedType, a);
let (b_with_fresh, _) = let (b_with_fresh, _) =
self.infcx().replace_late_bound_regions_with_fresh_var( self.infcx().replace_late_bound_regions_with_fresh_var(
span, infer::HigherRankedType, b); span, HigherRankedType, b);
// Collect constraints. // Collect constraints.
let result0 = let result0 =
@ -221,10 +222,10 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C
// Instantiate each bound region with a fresh region variable. // Instantiate each bound region with a fresh region variable.
let (a_with_fresh, a_map) = let (a_with_fresh, a_map) =
self.infcx().replace_late_bound_regions_with_fresh_var( self.infcx().replace_late_bound_regions_with_fresh_var(
self.trace().origin.span(), infer::HigherRankedType, a); self.trace().origin.span(), HigherRankedType, a);
let (b_with_fresh, b_map) = let (b_with_fresh, b_map) =
self.infcx().replace_late_bound_regions_with_fresh_var( self.infcx().replace_late_bound_regions_with_fresh_var(
self.trace().origin.span(), infer::HigherRankedType, b); self.trace().origin.span(), HigherRankedType, b);
let a_vars = var_ids(self, &a_map); let a_vars = var_ids(self, &a_map);
let b_vars = var_ids(self, &b_map); let b_vars = var_ids(self, &b_map);

View File

@ -29,12 +29,13 @@
//! over a `LatticeValue`, which is a value defined with respect to //! over a `LatticeValue`, which is a value defined with respect to
//! a lattice. //! a lattice.
use super::*;
use super::combine::*;
use super::glb::Glb;
use super::lub::Lub;
use middle::ty::{TyVar}; use middle::ty::{TyVar};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::*;
use middle::typeck::infer::combine::*;
use middle::typeck::infer::glb::Glb;
use middle::typeck::infer::lub::Lub;
use util::ppaux::Repr; use util::ppaux::Repr;
pub trait LatticeDir<'tcx> { pub trait LatticeDir<'tcx> {

View File

@ -8,16 +8,17 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use super::combine::*;
use super::equate::Equate;
use super::glb::Glb;
use super::higher_ranked::HigherRankedRelations;
use super::lattice::*;
use super::sub::Sub;
use super::{cres, InferCtxt};
use super::{TypeTrace, Subtype};
use middle::ty::{BuiltinBounds}; use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::combine::*;
use middle::typeck::infer::equate::Equate;
use middle::typeck::infer::glb::Glb;
use middle::typeck::infer::higher_ranked::HigherRankedRelations;
use middle::typeck::infer::lattice::*;
use middle::typeck::infer::sub::Sub;
use middle::typeck::infer::{cres, InferCtxt};
use middle::typeck::infer::{TypeTrace, Subtype};
use syntax::ast::{Many, Once}; use syntax::ast::{Many, Once};
use syntax::ast::{NormalFn, UnsafeFn}; use syntax::ast::{NormalFn, UnsafeFn};
use syntax::ast::{Onceness, FnStyle}; use syntax::ast::{Onceness, FnStyle};

View File

@ -18,14 +18,14 @@ pub use self::RegionResolutionError::*;
pub use self::VarValue::*; pub use self::VarValue::*;
use self::Classification::*; use self::Classification::*;
use super::cres;
use super::{RegionVariableOrigin, SubregionOrigin, TypeTrace, MiscVariable};
use middle::region; use middle::region;
use middle::ty; use middle::ty;
use middle::ty::{BoundRegion, FreeRegion, Region, RegionVid}; use middle::ty::{BoundRegion, FreeRegion, Region, RegionVid};
use middle::ty::{ReEmpty, ReStatic, ReInfer, ReFree, ReEarlyBound}; use middle::ty::{ReEmpty, ReStatic, ReInfer, ReFree, ReEarlyBound};
use middle::ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh}; use middle::ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh};
use middle::typeck::infer::cres;
use middle::typeck::infer::{RegionVariableOrigin, SubregionOrigin, TypeTrace};
use middle::typeck::infer;
use middle::graph; use middle::graph;
use middle::graph::{Direction, NodeIndex}; use middle::graph::{Direction, NodeIndex};
use util::common::indenter; use util::common::indenter;
@ -573,7 +573,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
} }
None => {} None => {}
} }
let c = self.new_region_var(infer::MiscVariable(origin.span())); let c = self.new_region_var(MiscVariable(origin.span()));
self.combine_map(t).borrow_mut().insert(vars, c); self.combine_map(t).borrow_mut().insert(vars, c);
if self.in_snapshot() { if self.in_snapshot() {
self.undo_log.borrow_mut().push(AddCombination(t, vars)); self.undo_log.borrow_mut().push(AddCombination(t, vars));

View File

@ -48,12 +48,13 @@
#![allow(non_upper_case_globals)] #![allow(non_upper_case_globals)]
use super::{fixup_err, fres, InferCtxt};
use super::{unresolved_int_ty,unresolved_float_ty,unresolved_ty};
use middle::ty::{FloatVar, FloatVid, IntVar, IntVid, RegionVid, TyVar, TyVid}; use middle::ty::{FloatVar, FloatVid, IntVar, IntVid, RegionVid, TyVar, TyVid};
use middle::ty::{IntType, UintType}; use middle::ty::{IntType, UintType};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::ty_fold; use middle::ty_fold;
use middle::typeck::infer::{fixup_err, fres, InferCtxt};
use middle::typeck::infer::{unresolved_int_ty,unresolved_float_ty,unresolved_ty};
use syntax::codemap::Span; use syntax::codemap::Span;
use util::ppaux::{Repr, ty_to_string}; use util::ppaux::{Repr, ty_to_string};

View File

@ -8,19 +8,19 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use super::combine::*;
use super::{cres, CresCompare};
use super::equate::Equate;
use super::glb::Glb;
use super::higher_ranked::HigherRankedRelations;
use super::InferCtxt;
use super::lub::Lub;
use super::{TypeTrace, Subtype};
use super::type_variable::{SubtypeOf, SupertypeOf};
use middle::ty::{BuiltinBounds}; use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::ty::TyVar; use middle::ty::TyVar;
use middle::typeck::infer::combine::*;
use middle::typeck::infer::{cres, CresCompare};
use middle::typeck::infer::equate::Equate;
use middle::typeck::infer::glb::Glb;
use middle::typeck::infer::higher_ranked::HigherRankedRelations;
use middle::typeck::infer::InferCtxt;
use middle::typeck::infer::lub::Lub;
use middle::typeck::infer::{TypeTrace, Subtype};
use middle::typeck::infer::type_variable::{SubtypeOf, SupertypeOf};
use util::ppaux::{Repr}; use util::ppaux::{Repr};
use syntax::ast::{Onceness, FnStyle, MutImmutable, MutMutable}; use syntax::ast::{Onceness, FnStyle, MutImmutable, MutMutable};

View File

@ -14,8 +14,8 @@ use std::kinds::marker;
use middle::ty::{expected_found, IntVarValue}; use middle::ty::{expected_found, IntVarValue};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::{uok, ures}; use middle::infer::{uok, ures};
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use std::cell::RefCell; use std::cell::RefCell;
use std::fmt::Show; use std::fmt::Show;
use syntax::ast; use syntax::ast;

View File

@ -17,7 +17,7 @@ use super::util;
use middle::subst; use middle::subst;
use middle::subst::Subst; use middle::subst::Subst;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::{mod, InferCtxt}; use middle::infer::{mod, InferCtxt};
use syntax::ast; use syntax::ast;
use syntax::codemap::DUMMY_SP; use syntax::codemap::DUMMY_SP;
use util::ppaux::Repr; use util::ppaux::Repr;

View File

@ -10,7 +10,7 @@
use middle::mem_categorization::Typer; use middle::mem_categorization::Typer;
use middle::ty; use middle::ty;
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use std::collections::HashSet; use std::collections::HashSet;
use std::rc::Rc; use std::rc::Rc;
use util::ppaux::Repr; use util::ppaux::Repr;

View File

@ -18,7 +18,7 @@ pub use self::ObligationCauseCode::*;
use middle::mem_categorization::Typer; use middle::mem_categorization::Typer;
use middle::subst; use middle::subst;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use std::rc::Rc; use std::rc::Rc;
use std::slice::Items; use std::slice::Items;
use syntax::ast; use syntax::ast;

View File

@ -30,8 +30,8 @@ use middle::fast_reject;
use middle::mem_categorization::Typer; use middle::mem_categorization::Typer;
use middle::subst::{Subst, Substs, VecPerParamSpace}; use middle::subst::{Subst, Substs, VecPerParamSpace};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer; use middle::infer;
use middle::typeck::infer::{InferCtxt, TypeSkolemizer}; use middle::infer::{InferCtxt, TypeSkolemizer};
use middle::ty_fold::TypeFoldable; use middle::ty_fold::TypeFoldable;
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::hash_map::HashMap; use std::collections::hash_map::HashMap;

View File

@ -11,7 +11,7 @@
use middle::subst; use middle::subst;
use middle::subst::{ParamSpace, Substs, VecPerParamSpace}; use middle::subst::{ParamSpace, Substs, VecPerParamSpace};
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use std::collections::HashSet; use std::collections::HashSet;
use std::fmt; use std::fmt;

View File

@ -14,7 +14,7 @@ use middle::subst::{Subst, Substs};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::check::{check_expr, check_expr_has_type, demand, FnCtxt}; use middle::typeck::check::{check_expr, check_expr_has_type, demand, FnCtxt};
use middle::typeck::check::{instantiate_path, structurally_resolved_type, valid_range_bounds}; use middle::typeck::check::{instantiate_path, structurally_resolved_type, valid_range_bounds};
use middle::typeck::infer::{mod, resolve}; use middle::infer::{mod, resolve};
use middle::typeck::require_same_types; use middle::typeck::require_same_types;
use util::nodemap::FnvHashMap; use util::nodemap::FnvHashMap;

View File

@ -14,10 +14,10 @@ use super::check_fn;
use super::{Expectation, ExpectCastableToType, ExpectHasType, NoExpectation}; use super::{Expectation, ExpectCastableToType, ExpectHasType, NoExpectation};
use super::FnCtxt; use super::FnCtxt;
use middle::infer;
use middle::subst; use middle::subst;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::astconv; use middle::typeck::astconv;
use middle::typeck::infer;
use middle::typeck::rscope::RegionScope; use middle::typeck::rscope::RegionScope;
use syntax::abi; use syntax::abi;
use syntax::ast; use syntax::ast;

View File

@ -11,9 +11,9 @@
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::check::FnCtxt; use middle::typeck::check::FnCtxt;
use middle::typeck::infer; use middle::infer;
use middle::typeck::infer::resolve_type; use middle::infer::resolve_type;
use middle::typeck::infer::resolve::try_resolve_tvar_shallow; use middle::infer::resolve::try_resolve_tvar_shallow;
use std::result::{Err, Ok}; use std::result::{Err, Ok};
use std::result; use std::result;

View File

@ -16,7 +16,8 @@ use middle::ty::{mod, Ty};
use middle::ty::{MethodCall, MethodCallee, MethodObject, MethodOrigin, use middle::ty::{MethodCall, MethodCallee, MethodObject, MethodOrigin,
MethodParam, MethodStatic, MethodTraitObject, MethodTypeParam}; MethodParam, MethodStatic, MethodTraitObject, MethodTypeParam};
use middle::typeck::check::{mod, FnCtxt, NoPreference, PreferMutLvalue}; use middle::typeck::check::{mod, FnCtxt, NoPreference, PreferMutLvalue};
use middle::typeck::infer::{mod, InferCtxt}; use middle::infer;
use middle::infer::InferCtxt;
use middle::ty_fold::HigherRankedFoldable; use middle::ty_fold::HigherRankedFoldable;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax::codemap::Span;

View File

@ -20,7 +20,7 @@ use middle::typeck::check::{FnCtxt};
use middle::typeck::check::{impl_self_ty}; use middle::typeck::check::{impl_self_ty};
use middle::typeck::check::vtable; use middle::typeck::check::vtable;
use middle::typeck::check::vtable::select_new_fcx_obligations; use middle::typeck::check::vtable::select_new_fcx_obligations;
use middle::typeck::infer; use middle::infer;
use util::ppaux::{Repr, UserString}; use util::ppaux::{Repr, UserString};
use std::rc::Rc; use std::rc::Rc;

View File

@ -21,8 +21,8 @@ use middle::ty::{MethodObject};
use middle::ty_fold::HigherRankedFoldable; use middle::ty_fold::HigherRankedFoldable;
use middle::typeck::check; use middle::typeck::check;
use middle::typeck::check::{FnCtxt, NoPreference}; use middle::typeck::check::{FnCtxt, NoPreference};
use middle::typeck::infer; use middle::infer;
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use syntax::ast; use syntax::ast;
use syntax::codemap::{Span, DUMMY_SP}; use syntax::codemap::{Span, DUMMY_SP};
use std::collections::HashSet; use std::collections::HashSet;

View File

@ -84,6 +84,7 @@ use self::TupleArgumentsFlag::*;
use session::Session; use session::Session;
use middle::{const_eval, def, traits}; use middle::{const_eval, def, traits};
use middle::infer;
use middle::lang_items::IteratorItem; use middle::lang_items::IteratorItem;
use middle::mem_categorization::{mod, McResult}; use middle::mem_categorization::{mod, McResult};
use middle::pat_util::{mod, pat_id_map}; use middle::pat_util::{mod, pat_id_map};
@ -98,7 +99,7 @@ use middle::ty_fold::TypeFolder;
use middle::typeck::astconv::{mod, ast_region_to_region, ast_ty_to_ty, AstConv}; use middle::typeck::astconv::{mod, ast_region_to_region, ast_ty_to_ty, AstConv};
use middle::typeck::check::_match::pat_ctxt; use middle::typeck::check::_match::pat_ctxt;
use middle::typeck::rscope::RegionScope; use middle::typeck::rscope::RegionScope;
use middle::typeck::{CrateCtxt, infer, lookup_def_ccx, no_params, require_same_types}; use middle::typeck::{CrateCtxt, lookup_def_ccx, no_params, require_same_types};
use middle::typeck::TypeAndSubsts; use middle::typeck::TypeAndSubsts;
use middle::lang_items::TypeIdLangItem; use middle::lang_items::TypeIdLangItem;
use lint; use lint;

View File

@ -124,9 +124,9 @@ use middle::typeck::astconv::AstConv;
use middle::typeck::check::FnCtxt; use middle::typeck::check::FnCtxt;
use middle::typeck::check::regionmanip; use middle::typeck::check::regionmanip;
use middle::typeck::check::vtable; use middle::typeck::check::vtable;
use middle::typeck::infer::resolve_and_force_all_but_regions; use middle::infer::resolve_and_force_all_but_regions;
use middle::typeck::infer::resolve_type; use middle::infer::resolve_type;
use middle::typeck::infer; use middle::infer;
use middle::pat_util; use middle::pat_util;
use util::nodemap::{DefIdMap, NodeMap, FnvHashMap}; use util::nodemap::{DefIdMap, NodeMap, FnvHashMap};
use util::ppaux::{ty_to_string, Repr}; use util::ppaux::{ty_to_string, Repr};

View File

@ -17,7 +17,7 @@ use middle::traits::{ObligationCause};
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::check::{FnCtxt, use middle::typeck::check::{FnCtxt,
structurally_resolved_type}; structurally_resolved_type};
use middle::typeck::infer; use middle::infer;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax::codemap::Span;

View File

@ -19,9 +19,9 @@ use middle::ty::{mod, Ty, MethodCall, MethodCallee};
use middle::ty_fold::{TypeFolder,TypeFoldable}; use middle::ty_fold::{TypeFolder,TypeFoldable};
use middle::typeck::astconv::AstConv; use middle::typeck::astconv::AstConv;
use middle::typeck::check::FnCtxt; use middle::typeck::check::FnCtxt;
use middle::typeck::infer::{force_all, resolve_all, resolve_region}; use middle::infer::{force_all, resolve_all, resolve_region};
use middle::typeck::infer::resolve_type; use middle::infer::resolve_type;
use middle::typeck::infer; use middle::infer;
use middle::typeck::write_substs_to_tcx; use middle::typeck::write_substs_to_tcx;
use middle::typeck::write_ty_to_tcx; use middle::typeck::write_ty_to_tcx;
use util::ppaux::Repr; use util::ppaux::Repr;

View File

@ -32,9 +32,9 @@ use middle::ty::type_is_ty_var;
use middle::subst::Subst; use middle::subst::Subst;
use middle::ty; use middle::ty;
use middle::typeck::CrateCtxt; use middle::typeck::CrateCtxt;
use middle::typeck::infer::combine::Combine; use middle::infer::combine::Combine;
use middle::typeck::infer::InferCtxt; use middle::infer::InferCtxt;
use middle::typeck::infer::{new_infer_ctxt, resolve_ivar, resolve_type}; use middle::infer::{new_infer_ctxt, resolve_ivar, resolve_type};
use std::collections::{HashSet}; use std::collections::{HashSet};
use std::cell::RefCell; use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;

View File

@ -13,8 +13,7 @@
use middle::traits; use middle::traits;
use middle::ty; use middle::ty;
use middle::typeck::infer::{new_infer_ctxt}; use middle::infer::{mod, new_infer_ctxt};
use middle::typeck::infer;
use syntax::ast::{DefId}; use syntax::ast::{DefId};
use syntax::ast::{LOCAL_CRATE}; use syntax::ast::{LOCAL_CRATE};
use syntax::ast; use syntax::ast;

View File

@ -46,7 +46,7 @@ use middle::ty_fold::TypeFolder;
use middle::typeck::astconv::{AstConv, ty_of_arg}; use middle::typeck::astconv::{AstConv, ty_of_arg};
use middle::typeck::astconv::{ast_ty_to_ty, ast_region_to_region}; use middle::typeck::astconv::{ast_ty_to_ty, ast_region_to_region};
use middle::typeck::astconv; use middle::typeck::astconv;
use middle::typeck::infer; use middle::infer;
use middle::typeck::rscope::*; use middle::typeck::rscope::*;
use middle::typeck::{CrateCtxt, lookup_def_tcx, no_params, write_ty_to_tcx}; use middle::typeck::{CrateCtxt, lookup_def_tcx, no_params, write_ty_to_tcx};
use middle::typeck; use middle::typeck;

View File

@ -63,6 +63,7 @@ independently:
use middle::def; use middle::def;
use middle::resolve; use middle::resolve;
use middle::infer;
use middle::subst; use middle::subst;
use middle::subst::VecPerParamSpace; use middle::subst::VecPerParamSpace;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
@ -78,7 +79,6 @@ use syntax::{ast, ast_map, abi};
pub mod check; pub mod check;
pub mod rscope; pub mod rscope;
pub mod astconv; pub mod astconv;
pub mod infer;
pub mod collect; pub mod collect;
pub mod coherence; pub mod coherence;
pub mod variance; pub mod variance;

View File

@ -30,7 +30,7 @@
use driver::driver::CrateAnalysis; use driver::driver::CrateAnalysis;
use session::Session; use session::Session;
use middle::{def, typeck}; use middle::def;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use std::cell::Cell; use std::cell::Cell;

View File

@ -21,10 +21,10 @@ use middle::stability;
use middle::subst; use middle::subst;
use middle::subst::Subst; use middle::subst::Subst;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::typeck::infer::combine::Combine; use middle::infer::combine::Combine;
use middle::typeck::infer; use middle::infer;
use middle::typeck::infer::lub::Lub; use middle::infer::lub::Lub;
use middle::typeck::infer::glb::Glb; use middle::infer::glb::Glb;
use session::{mod,config}; use session::{mod,config};
use syntax::{abi, ast, ast_map, ast_util}; use syntax::{abi, ast, ast_map, ast_util};
use syntax::codemap; use syntax::codemap;

View File

@ -19,6 +19,7 @@ use llvm;
use llvm::{ValueRef, BasicBlockRef, BuilderRef, ContextRef}; use llvm::{ValueRef, BasicBlockRef, BuilderRef, ContextRef};
use llvm::{True, False, Bool}; use llvm::{True, False, Bool};
use middle::def; use middle::def;
use middle::infer;
use middle::lang_items::LangItem; use middle::lang_items::LangItem;
use middle::mem_categorization as mc; use middle::mem_categorization as mc;
use middle::region; use middle::region;
@ -36,7 +37,6 @@ use middle::traits;
use middle::ty::{mod, Ty}; use middle::ty::{mod, Ty};
use middle::ty_fold; use middle::ty_fold;
use middle::ty_fold::TypeFoldable; use middle::ty_fold::TypeFoldable;
use middle::typeck::infer;
use util::ppaux::Repr; use util::ppaux::Repr;
use util::nodemap::{DefIdMap, FnvHashMap, NodeMap}; use util::nodemap::{DefIdMap, FnvHashMap, NodeMap};

View File

@ -41,7 +41,6 @@ use middle::def;
use middle::mem_categorization::Typer; use middle::mem_categorization::Typer;
use middle::subst::{mod, Subst}; use middle::subst::{mod, Subst};
use trans::{_match, adt, asm, base, callee, closure, consts, controlflow}; use trans::{_match, adt, asm, base, callee, closure, consts, controlflow};
use trans::{debuginfo, glue, machine, meth, inline, tvec, type_of};
use trans::base::*; use trans::base::*;
use trans::build::*; use trans::build::*;
use trans::cleanup::{mod, CleanupMethods}; use trans::cleanup::{mod, CleanupMethods};