diff --git a/mk/crates.mk b/mk/crates.mk index 54733083aae..ae40a8e7f70 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -57,7 +57,7 @@ TARGET_CRATES := libc std term \ RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \ rustc_data_structures rustc_front rustc_platform_intrinsics \ - rustc_plugin rustc_metadata rustc_passes + rustc_plugin rustc_metadata rustc_passes rustc_save_analysis HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \ flate arena graphviz rbml log serialize TOOLS := compiletest rustdoc rustc rustbook error_index_generator @@ -102,7 +102,7 @@ DEPS_rustc_data_structures := std log serialize DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \ rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \ rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \ - rustc_metadata syntax_ext rustc_passes + rustc_metadata syntax_ext rustc_passes rustc_save_analysis DEPS_rustc_front := std syntax log serialize DEPS_rustc_lint := rustc log syntax DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags @@ -116,6 +116,7 @@ DEPS_rustc_privacy := rustc rustc_front log syntax DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \ log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \ rustc_const_eval +DEPS_rustc_save_analysis := rustc log syntax rustc_front DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_eval DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \ diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/cfg/construct.rs similarity index 99% rename from src/librustc/middle/cfg/construct.rs rename to src/librustc/cfg/construct.rs index dcfa8d1e36a..e75625f7fae 100644 --- a/src/librustc/middle/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -9,10 +9,10 @@ // except according to those terms. use rustc_data_structures::graph; -use middle::cfg::*; +use cfg::*; use middle::def::Def; use middle::pat_util; -use middle::ty::{self, TyCtxt}; +use ty::{self, TyCtxt}; use syntax::ast; use syntax::ptr::P; diff --git a/src/librustc/middle/cfg/graphviz.rs b/src/librustc/cfg/graphviz.rs similarity index 99% rename from src/librustc/middle/cfg/graphviz.rs rename to src/librustc/cfg/graphviz.rs index c9c712c2d6e..c867ec94b25 100644 --- a/src/librustc/middle/cfg/graphviz.rs +++ b/src/librustc/cfg/graphviz.rs @@ -18,7 +18,7 @@ use graphviz::IntoCow; use syntax::ast; use front::map as ast_map; -use middle::cfg; +use cfg; pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode); pub type Edge<'a> = &'a cfg::CFGEdge; diff --git a/src/librustc/middle/cfg/mod.rs b/src/librustc/cfg/mod.rs similarity index 98% rename from src/librustc/middle/cfg/mod.rs rename to src/librustc/cfg/mod.rs index 394633c5911..8df4dc5fce5 100644 --- a/src/librustc/middle/cfg/mod.rs +++ b/src/librustc/cfg/mod.rs @@ -12,7 +12,7 @@ //! Uses `Graph` as the underlying representation. use rustc_data_structures::graph; -use middle::ty::TyCtxt; +use ty::TyCtxt; use syntax::ast; use rustc_front::hir; diff --git a/src/librustc/dep_graph/mod.rs b/src/librustc/dep_graph/mod.rs index 821217d7582..731c33868df 100644 --- a/src/librustc/dep_graph/mod.rs +++ b/src/librustc/dep_graph/mod.rs @@ -11,7 +11,7 @@ use self::thread::{DepGraphThreadData, DepMessage}; use middle::def_id::DefId; use syntax::ast::NodeId; -use middle::ty::TyCtxt; +use ty::TyCtxt; use rustc_front::hir; use rustc_front::intravisit::Visitor; use std::rc::Rc; diff --git a/src/librustc/middle/infer/README.md b/src/librustc/infer/README.md similarity index 100% rename from src/librustc/middle/infer/README.md rename to src/librustc/infer/README.md diff --git a/src/librustc/middle/infer/bivariate.rs b/src/librustc/infer/bivariate.rs similarity index 97% rename from src/librustc/middle/infer/bivariate.rs rename to src/librustc/infer/bivariate.rs index 76a87675e3d..a9ea395e6b3 100644 --- a/src/librustc/middle/infer/bivariate.rs +++ b/src/librustc/infer/bivariate.rs @@ -28,9 +28,9 @@ use super::combine::{self, CombineFields}; use super::type_variable::{BiTo}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::TyVar; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::{self, Ty, TyCtxt}; +use ty::TyVar; +use ty::relate::{Relate, RelateResult, TypeRelation}; pub struct Bivariate<'a, 'tcx: 'a> { fields: CombineFields<'a, 'tcx> diff --git a/src/librustc/middle/infer/combine.rs b/src/librustc/infer/combine.rs similarity index 98% rename from src/librustc/middle/infer/combine.rs rename to src/librustc/infer/combine.rs index f67389e3c3b..2b30698882d 100644 --- a/src/librustc/middle/infer/combine.rs +++ b/src/librustc/infer/combine.rs @@ -41,11 +41,11 @@ use super::{InferCtxt}; use super::{MiscVariable, TypeTrace}; use super::type_variable::{RelationDir, BiTo, EqTo, SubtypeOf, SupertypeOf}; -use middle::ty::{IntType, UintType}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::error::TypeError; -use middle::ty::fold::{TypeFolder, TypeFoldable}; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::{IntType, UintType}; +use ty::{self, Ty, TyCtxt}; +use ty::error::TypeError; +use ty::fold::{TypeFolder, TypeFoldable}; +use ty::relate::{Relate, RelateResult, TypeRelation}; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc/middle/infer/equate.rs b/src/librustc/infer/equate.rs similarity index 96% rename from src/librustc/middle/infer/equate.rs rename to src/librustc/infer/equate.rs index dd576c75ba3..3c9c9c57884 100644 --- a/src/librustc/middle/infer/equate.rs +++ b/src/librustc/infer/equate.rs @@ -13,9 +13,9 @@ use super::higher_ranked::HigherRankedRelations; use super::{Subtype}; use super::type_variable::{EqTo}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::TyVar; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::{self, Ty, TyCtxt}; +use ty::TyVar; +use ty::relate::{Relate, RelateResult, TypeRelation}; /// Ensures `a` is made equal to `b`. Returns `a` on success. pub struct Equate<'a, 'tcx: 'a> { diff --git a/src/librustc/middle/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs similarity index 99% rename from src/librustc/middle/infer/error_reporting.rs rename to src/librustc/infer/error_reporting.rs index 089eae89d04..20c01344144 100644 --- a/src/librustc/middle/infer/error_reporting.rs +++ b/src/librustc/infer/error_reporting.rs @@ -80,12 +80,12 @@ use rustc_front::print::pprust; use middle::cstore::CrateStore; use middle::def::Def; use middle::def_id::DefId; -use middle::infer::{self, TypeOrigin}; +use infer::{self, TypeOrigin}; use middle::region; -use middle::subst; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; -use middle::ty::{Region, ReFree}; -use middle::ty::error::TypeError; +use ty::subst; +use ty::{self, Ty, TyCtxt, TypeFoldable}; +use ty::{Region, ReFree}; +use ty::error::TypeError; use std::cell::{Cell, RefCell}; use std::char::from_u32; diff --git a/src/librustc/middle/infer/freshen.rs b/src/librustc/infer/freshen.rs similarity index 98% rename from src/librustc/middle/infer/freshen.rs rename to src/librustc/infer/freshen.rs index b0f6d45dc53..352733a595d 100644 --- a/src/librustc/middle/infer/freshen.rs +++ b/src/librustc/infer/freshen.rs @@ -30,8 +30,8 @@ //! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type //! inferencer knows "so far". -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; -use middle::ty::fold::TypeFolder; +use ty::{self, Ty, TyCtxt, TypeFoldable}; +use ty::fold::TypeFolder; use std::collections::hash_map::{self, Entry}; use super::InferCtxt; diff --git a/src/librustc/middle/infer/glb.rs b/src/librustc/infer/glb.rs similarity index 96% rename from src/librustc/middle/infer/glb.rs rename to src/librustc/infer/glb.rs index 7779be896cf..235428a6898 100644 --- a/src/librustc/middle/infer/glb.rs +++ b/src/librustc/infer/glb.rs @@ -14,8 +14,8 @@ use super::InferCtxt; use super::lattice::{self, LatticeDir}; use super::Subtype; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::{self, Ty, TyCtxt}; +use ty::relate::{Relate, RelateResult, TypeRelation}; /// "Greatest lower bound" (common subtype) pub struct Glb<'a, 'tcx: 'a> { diff --git a/src/librustc/middle/infer/higher_ranked/README.md b/src/librustc/infer/higher_ranked/README.md similarity index 100% rename from src/librustc/middle/infer/higher_ranked/README.md rename to src/librustc/infer/higher_ranked/README.md diff --git a/src/librustc/middle/infer/higher_ranked/mod.rs b/src/librustc/infer/higher_ranked/mod.rs similarity index 99% rename from src/librustc/middle/infer/higher_ranked/mod.rs rename to src/librustc/infer/higher_ranked/mod.rs index 44ba6ec4a7a..db4ee17bafb 100644 --- a/src/librustc/middle/infer/higher_ranked/mod.rs +++ b/src/librustc/infer/higher_ranked/mod.rs @@ -14,9 +14,9 @@ use super::{CombinedSnapshot, InferCtxt, HigherRankedType, SkolemizationMap}; use super::combine::CombineFields; -use middle::ty::{self, TyCtxt, Binder, TypeFoldable}; -use middle::ty::error::TypeError; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::{self, TyCtxt, Binder, TypeFoldable}; +use ty::error::TypeError; +use ty::relate::{Relate, RelateResult, TypeRelation}; use syntax::codemap::Span; use util::nodemap::{FnvHashMap, FnvHashSet}; diff --git a/src/librustc/middle/infer/lattice.rs b/src/librustc/infer/lattice.rs similarity index 96% rename from src/librustc/middle/infer/lattice.rs rename to src/librustc/infer/lattice.rs index dc4cbd14a5d..17ad32e742e 100644 --- a/src/librustc/middle/infer/lattice.rs +++ b/src/librustc/infer/lattice.rs @@ -32,9 +32,9 @@ use super::combine; use super::InferCtxt; -use middle::ty::TyVar; -use middle::ty::{self, Ty}; -use middle::ty::relate::{RelateResult, TypeRelation}; +use ty::TyVar; +use ty::{self, Ty}; +use ty::relate::{RelateResult, TypeRelation}; pub trait LatticeDir<'f,'tcx> : TypeRelation<'f,'tcx> { fn infcx(&self) -> &'f InferCtxt<'f, 'tcx>; diff --git a/src/librustc/middle/infer/lub.rs b/src/librustc/infer/lub.rs similarity index 96% rename from src/librustc/middle/infer/lub.rs rename to src/librustc/infer/lub.rs index 7202e4afc5a..00b85929b4b 100644 --- a/src/librustc/middle/infer/lub.rs +++ b/src/librustc/infer/lub.rs @@ -14,8 +14,8 @@ use super::InferCtxt; use super::lattice::{self, LatticeDir}; use super::Subtype; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::{self, Ty, TyCtxt}; +use ty::relate::{Relate, RelateResult, TypeRelation}; /// "Least upper bound" (common supertype) pub struct Lub<'a, 'tcx: 'a> { diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/infer/mod.rs similarity index 99% rename from src/librustc/middle/infer/mod.rs rename to src/librustc/infer/mod.rs index 645e5323ef4..bc4c9fd2ccf 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -14,7 +14,7 @@ pub use self::LateBoundRegionConversionTime::*; pub use self::RegionVariableOrigin::*; pub use self::SubregionOrigin::*; pub use self::ValuePairs::*; -pub use middle::ty::IntVarValue; +pub use ty::IntVarValue; pub use self::freshen::TypeFreshener; pub use self::region_inference::{GenericKind, VerifyBound}; @@ -24,16 +24,16 @@ use middle::free_region::FreeRegionMap; use middle::mem_categorization as mc; use middle::mem_categorization::McResult; use middle::region::CodeExtent; -use middle::subst; -use middle::subst::Substs; -use middle::subst::Subst; -use middle::traits::{self, ProjectionMode}; -use middle::ty::adjustment; -use middle::ty::{TyVid, IntVid, FloatVid}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric}; -use middle::ty::fold::{TypeFolder, TypeFoldable}; -use middle::ty::relate::{Relate, RelateResult, TypeRelation}; +use ty::subst; +use ty::subst::Substs; +use ty::subst::Subst; +use traits::{self, ProjectionMode}; +use ty::adjustment; +use ty::{TyVid, IntVid, FloatVid}; +use ty::{self, Ty, TyCtxt}; +use ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric}; +use ty::fold::{TypeFolder, TypeFoldable}; +use ty::relate::{Relate, RelateResult, TypeRelation}; use rustc_data_structures::unify::{self, UnificationTable}; use std::cell::{RefCell, Ref}; use std::fmt; @@ -622,8 +622,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { } pub fn type_is_unconstrained_numeric(&'a self, ty: Ty) -> UnconstrainedNumeric { - use middle::ty::error::UnconstrainedNumeric::Neither; - use middle::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; + use ty::error::UnconstrainedNumeric::Neither; + use ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; match ty.sty { ty::TyInfer(ty::IntVar(vid)) => { if self.int_unification_table.borrow_mut().has_value(vid) { diff --git a/src/librustc/middle/infer/region_inference/README.md b/src/librustc/infer/region_inference/README.md similarity index 100% rename from src/librustc/middle/infer/region_inference/README.md rename to src/librustc/infer/region_inference/README.md diff --git a/src/librustc/middle/infer/region_inference/graphviz.rs b/src/librustc/infer/region_inference/graphviz.rs similarity index 98% rename from src/librustc/middle/infer/region_inference/graphviz.rs rename to src/librustc/infer/region_inference/graphviz.rs index 23559e7b340..e561f4a3548 100644 --- a/src/librustc/middle/infer/region_inference/graphviz.rs +++ b/src/librustc/infer/region_inference/graphviz.rs @@ -18,11 +18,11 @@ /// For clarity, rename the graphviz crate locally to dot. use graphviz as dot; -use middle::ty::{self, TyCtxt}; +use ty::{self, TyCtxt}; use middle::region::CodeExtent; use super::Constraint; -use middle::infer::SubregionOrigin; -use middle::infer::region_inference::RegionVarBindings; +use infer::SubregionOrigin; +use infer::region_inference::RegionVarBindings; use util::nodemap::{FnvHashMap, FnvHashSet}; use std::borrow::Cow; diff --git a/src/librustc/middle/infer/region_inference/mod.rs b/src/librustc/infer/region_inference/mod.rs similarity index 99% rename from src/librustc/middle/infer/region_inference/mod.rs rename to src/librustc/infer/region_inference/mod.rs index 7bba495e467..2b74dcb40c4 100644 --- a/src/librustc/middle/infer/region_inference/mod.rs +++ b/src/librustc/infer/region_inference/mod.rs @@ -23,10 +23,10 @@ use super::unify_key; use rustc_data_structures::graph::{self, Direction, NodeIndex}; use rustc_data_structures::unify::{self, UnificationTable}; use middle::free_region::FreeRegionMap; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::{BoundRegion, Region, RegionVid}; -use middle::ty::{ReEmpty, ReStatic, ReFree, ReEarlyBound}; -use middle::ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh}; +use ty::{self, Ty, TyCtxt}; +use ty::{BoundRegion, Region, RegionVid}; +use ty::{ReEmpty, ReStatic, ReFree, ReEarlyBound}; +use ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh}; use util::common::indenter; use util::nodemap::{FnvHashMap, FnvHashSet}; diff --git a/src/librustc/middle/infer/resolve.rs b/src/librustc/infer/resolve.rs similarity index 99% rename from src/librustc/middle/infer/resolve.rs rename to src/librustc/infer/resolve.rs index 8c610589844..c54843410ad 100644 --- a/src/librustc/middle/infer/resolve.rs +++ b/src/librustc/infer/resolve.rs @@ -9,7 +9,7 @@ // except according to those terms. use super::{InferCtxt, FixupError, FixupResult}; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +use ty::{self, Ty, TyCtxt, TypeFoldable}; /////////////////////////////////////////////////////////////////////////// // OPPORTUNISTIC TYPE RESOLVER diff --git a/src/librustc/middle/infer/sub.rs b/src/librustc/infer/sub.rs similarity index 96% rename from src/librustc/middle/infer/sub.rs rename to src/librustc/infer/sub.rs index e94311697c3..0505c9d627b 100644 --- a/src/librustc/middle/infer/sub.rs +++ b/src/librustc/infer/sub.rs @@ -13,9 +13,9 @@ use super::higher_ranked::HigherRankedRelations; use super::SubregionOrigin; use super::type_variable::{SubtypeOf, SupertypeOf}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::TyVar; -use middle::ty::relate::{Cause, Relate, RelateResult, TypeRelation}; +use ty::{self, Ty, TyCtxt}; +use ty::TyVar; +use ty::relate::{Cause, Relate, RelateResult, TypeRelation}; use std::mem; /// Ensures `a` is made a subtype of `b`. Returns `a` on success. diff --git a/src/librustc/middle/infer/type_variable.rs b/src/librustc/infer/type_variable.rs similarity index 99% rename from src/librustc/middle/infer/type_variable.rs rename to src/librustc/infer/type_variable.rs index fe66ea5a1ea..c8da346085d 100644 --- a/src/librustc/middle/infer/type_variable.rs +++ b/src/librustc/infer/type_variable.rs @@ -12,7 +12,7 @@ pub use self::RelationDir::*; use self::TypeVariableValue::*; use self::UndoEntry::*; use middle::def_id::{DefId}; -use middle::ty::{self, Ty}; +use ty::{self, Ty}; use syntax::codemap::Span; use std::cmp::min; diff --git a/src/librustc/middle/infer/unify_key.rs b/src/librustc/infer/unify_key.rs similarity index 98% rename from src/librustc/middle/infer/unify_key.rs rename to src/librustc/infer/unify_key.rs index 3f8c3fbce04..a9eb20b8299 100644 --- a/src/librustc/middle/infer/unify_key.rs +++ b/src/librustc/infer/unify_key.rs @@ -9,7 +9,7 @@ // except according to those terms. use syntax::ast; -use middle::ty::{self, IntVarValue, Ty, TyCtxt}; +use ty::{self, IntVarValue, Ty, TyCtxt}; use rustc_data_structures::unify::{Combine, UnifyKey}; pub trait ToType<'tcx> { diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index d8d0079b3e3..4fdfe59e2b0 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -78,6 +78,7 @@ pub mod back { pub use rustc_back::svh; } +pub mod cfg; pub mod dep_graph; pub mod front { @@ -85,10 +86,12 @@ pub mod front { pub mod map; } +pub mod infer; +pub mod lint; + pub mod middle { pub mod astconv_util; pub mod expr_use_visitor; // STAGE0: increase glitch immunity - pub mod cfg; pub mod check_match; pub mod const_eval; pub mod const_qualif; @@ -102,7 +105,6 @@ pub mod middle { pub mod entry; pub mod free_region; pub mod intrinsicck; - pub mod infer; pub mod lang_items; pub mod liveness; pub mod mem_categorization; @@ -113,9 +115,6 @@ pub mod middle { pub mod recursion_limit; pub mod resolve_lifetime; pub mod stability; - pub mod subst; - pub mod traits; - pub mod ty; pub mod weak_lang_items; } @@ -128,8 +127,8 @@ pub mod mir { } pub mod session; - -pub mod lint; +pub mod traits; +pub mod ty; pub mod util { pub use rustc_back::sha2; diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 079a0c94cc5..8224422d45c 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -27,7 +27,7 @@ use self::TargetLint::*; use dep_graph::DepNode; use middle::privacy::AccessLevels; -use middle::ty::TyCtxt; +use ty::TyCtxt; use session::{config, early_error, Session}; use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass}; use lint::{EarlyLintPass, EarlyLintPassObject, LateLintPass, LateLintPassObject}; diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs index e17aaaca16e..a6907aad297 100644 --- a/src/librustc/middle/astconv_util.rs +++ b/src/librustc/middle/astconv_util.rs @@ -15,7 +15,7 @@ */ use middle::def::Def; -use middle::ty::{Ty, TyCtxt}; +use ty::{Ty, TyCtxt}; use syntax::codemap::Span; use rustc_front::hir as ast; diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 3414d509d95..79e4b7c0901 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -22,12 +22,12 @@ use middle::def_id::{DefId}; use middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor}; use middle::expr_use_visitor::{LoanCause, MutateMode}; use middle::expr_use_visitor as euv; -use middle::infer; +use infer; use middle::mem_categorization::{cmt}; use middle::pat_util::*; -use middle::traits::ProjectionMode; -use middle::ty::*; -use middle::ty; +use traits::ProjectionMode; +use ty::*; +use ty; use std::cmp::Ordering; use std::fmt; use std::iter::{FromIterator, IntoIterator, repeat}; diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index c102822e8c1..fca2904979c 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -18,13 +18,13 @@ use front::map as ast_map; use front::map::blocks::FnLikeNode; use lint; use middle::cstore::{self, CrateStore, InlinedItem}; -use middle::{infer, subst, traits}; +use {infer, traits}; use middle::def::Def; use middle::def_id::DefId; use middle::pat_util::def_to_path; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::util::IntTypeExt; -use middle::traits::ProjectionMode; +use ty::{self, subst, Ty, TyCtxt}; +use ty::util::IntTypeExt; +use traits::ProjectionMode; use middle::astconv_util::ast_ty_to_prim_ty; use util::nodemap::NodeMap; diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs index 7cad9b10f85..a0dacd62268 100644 --- a/src/librustc/middle/cstore.rs +++ b/src/librustc/middle/cstore.rs @@ -26,7 +26,7 @@ use back::svh::Svh; use front::map as hir_map; use middle::def::{self, Def}; use middle::lang_items; -use middle::ty::{self, Ty, TyCtxt, VariantKind}; +use ty::{self, Ty, TyCtxt, VariantKind}; use middle::def_id::{DefId, DefIndex}; use mir::repr::Mir; use mir::mir_map::MirMap; @@ -498,8 +498,8 @@ pub mod tls { use serialize; use std::cell::Cell; use std::mem; - use middle::ty::{self, Ty, TyCtxt}; - use middle::subst::Substs; + use ty::{self, Ty, TyCtxt}; + use ty::subst::Substs; use middle::def_id::DefId; pub trait EncodingContext<'tcx> { diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index d8cffa3c2c9..6468187e219 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -14,9 +14,9 @@ //! and thus uses bitvectors. Your job is simply to specify the so-called //! GEN and KILL bits for each expression. -use middle::cfg; -use middle::cfg::CFGIndex; -use middle::ty::TyCtxt; +use cfg; +use cfg::CFGIndex; +use ty::TyCtxt; use std::io; use std::mem; use std::usize; diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 4ceac287d19..2b8ed14701d 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -17,8 +17,8 @@ use front::map as ast_map; use rustc_front::hir::{self, PatKind}; use rustc_front::intravisit::{self, Visitor}; -use middle::{pat_util, privacy, ty}; -use middle::ty::TyCtxt; +use middle::{pat_util, privacy}; +use ty::{self, TyCtxt}; use middle::def::Def; use middle::def_id::{DefId}; use lint; @@ -84,7 +84,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> { } fn lookup_and_handle_definition(&mut self, id: &ast::NodeId) { - use middle::ty::TypeVariants::{TyEnum, TyStruct}; + use ty::TypeVariants::{TyEnum, TyStruct}; // If `bar` is a trait item, make sure to mark Foo as alive in `Foo::bar` self.tcx.tables.borrow().item_substs.get(id) diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index 6d4799749b9..6cbcd41d84a 100644 --- a/src/librustc/middle/def.rs +++ b/src/librustc/middle/def.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::def_id::DefId; -use middle::subst::ParamSpace; +use ty::subst::ParamSpace; use util::nodemap::NodeMap; use syntax::ast; use rustc_front::hir; diff --git a/src/librustc/middle/def_id.rs b/src/librustc/middle/def_id.rs index f5bdf28a4b1..a3b83ec5be4 100644 --- a/src/librustc/middle/def_id.rs +++ b/src/librustc/middle/def_id.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::cstore::LOCAL_CRATE; -use middle::ty; +use ty; use syntax::ast::CrateNum; use std::fmt; use std::u32; diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index d4ff4b797c8..fa949073f4e 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -14,8 +14,8 @@ use self::RootUnsafeContext::*; use dep_graph::DepNode; use middle::def::Def; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::MethodCall; +use ty::{self, Ty, TyCtxt}; +use ty::MethodCall; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index ded64fa1d30..744022d1d5e 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -22,9 +22,9 @@ use self::OverloadedCallType::*; use middle::pat_util; use middle::def::Def; use middle::def_id::{DefId}; -use middle::infer; +use infer; use middle::mem_categorization as mc; -use middle::ty::{self, TyCtxt, adjustment}; +use ty::{self, TyCtxt, adjustment}; use rustc_front::hir::{self, PatKind}; diff --git a/src/librustc/middle/free_region.rs b/src/librustc/middle/free_region.rs index cb45a3e2507..20f2c5ad43f 100644 --- a/src/librustc/middle/free_region.rs +++ b/src/librustc/middle/free_region.rs @@ -15,8 +15,8 @@ //! `TransitiveRelation` type and use that to decide when one free //! region outlives another and so forth. -use middle::ty::{self, TyCtxt, FreeRegion, Region}; -use middle::ty::wf::ImpliedBound; +use ty::{self, TyCtxt, FreeRegion, Region}; +use ty::wf::ImpliedBound; use rustc_data_structures::transitive_relation::TransitiveRelation; #[derive(Clone)] diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index 233e55cdbb5..939ea91cdd4 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -11,9 +11,9 @@ use dep_graph::DepNode; use middle::def::Def; use middle::def_id::DefId; -use middle::subst::{Subst, Substs, EnumeratedItems}; -use middle::ty::{TransmuteRestriction, TyCtxt}; -use middle::ty::{self, Ty, TypeFoldable}; +use ty::subst::{Subst, Substs, EnumeratedItems}; +use ty::{TransmuteRestriction, TyCtxt}; +use ty::{self, Ty, TypeFoldable}; use std::fmt; diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index b08c2d6054c..bb0b8ed91df 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -26,7 +26,7 @@ use front::map as hir_map; use session::Session; use middle::cstore::CrateStore; use middle::def_id::DefId; -use middle::ty; +use ty; use middle::weak_lang_items; use util::nodemap::FnvHashMap; diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 9507c379b4f..f6eedb49e24 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -112,10 +112,10 @@ use self::VarKind::*; use dep_graph::DepNode; use middle::def::*; use middle::pat_util; -use middle::ty::{self, TyCtxt, ParameterEnvironment}; -use middle::traits::{self, ProjectionMode}; -use middle::infer; -use middle::subst::Subst; +use ty::{self, TyCtxt, ParameterEnvironment}; +use traits::{self, ProjectionMode}; +use infer; +use ty::subst::Subst; use lint; use util::nodemap::NodeMap; diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index d2bc80a2cb2..6328f920cb7 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -73,11 +73,11 @@ use self::Aliasability::*; use middle::def_id::DefId; use front::map as ast_map; -use middle::infer; +use infer; use middle::const_qualif::ConstQualif; use middle::def::Def; -use middle::ty::adjustment; -use middle::ty::{self, Ty, TyCtxt}; +use ty::adjustment; +use ty::{self, Ty, TyCtxt}; use rustc_front::hir::{MutImmutable, MutMutable, PatKind}; use rustc_front::hir; diff --git a/src/librustc/middle/pat_util.rs b/src/librustc/middle/pat_util.rs index 81166945115..b2b1344c4bb 100644 --- a/src/librustc/middle/pat_util.rs +++ b/src/librustc/middle/pat_util.rs @@ -10,7 +10,7 @@ use middle::def::*; use middle::def_id::DefId; -use middle::ty::TyCtxt; +use ty::TyCtxt; use util::nodemap::FnvHashMap; use syntax::ast; diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 601f069513d..2e01a7fc249 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -19,7 +19,7 @@ use dep_graph::DepNode; use front::map as ast_map; use middle::def::Def; use middle::def_id::DefId; -use middle::ty::{self, TyCtxt}; +use ty::{self, TyCtxt}; use middle::privacy; use session::config; use util::nodemap::NodeSet; diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index eb375205dee..1d1d05ea79f 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -21,7 +21,7 @@ use front::map as ast_map; use session::Session; use util::nodemap::{FnvHashMap, NodeMap, NodeSet}; use middle::cstore::InlinedItem; -use middle::ty; +use ty; use std::cell::RefCell; use std::collections::hash_map::Entry; @@ -280,7 +280,7 @@ pub struct RegionMaps { /// 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 middle::infer::region_inference for + /// section of the README in infer::region_inference for /// more details. fn_tree: RefCell>, } @@ -291,7 +291,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 middle::infer::region_inference for more + /// the README in infer::region_inference for more /// details. root_id: Option, @@ -460,7 +460,7 @@ impl RegionMaps { self.scope_map.borrow()[id.0 as usize].into_option() } - #[allow(dead_code)] // used in middle::cfg + #[allow(dead_code)] // used in cfg pub fn encl_scope(&self, id: CodeExtent) -> CodeExtent { //! Returns the narrowest scope that encloses `id`, if any. self.opt_encl_scope(id).unwrap() @@ -587,7 +587,7 @@ impl RegionMaps { // different functions. Compare those fn for lexical // nesting. The reasoning behind this is subtle. See the // "Modeling closures" section of the README in - // middle::infer::region_inference for more details. + // infer::region_inference for more details. let a_root_scope = self.code_extent_data(a_ancestors[a_index]); let b_root_scope = self.code_extent_data(a_ancestors[a_index]); return match (a_root_scope, b_root_scope) { diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index a80b130e5be..6342599bf73 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -23,8 +23,8 @@ use front::map::Map; use session::Session; use middle::def::{Def, DefMap}; use middle::region; -use middle::subst; -use middle::ty; +use ty::subst; +use ty; use std::fmt; use std::mem::replace; use syntax::ast; diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 2d92742ed0f..3a2f995a318 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -20,7 +20,7 @@ use lint; use middle::cstore::{CrateStore, LOCAL_CRATE}; use middle::def::Def; use middle::def_id::{CRATE_DEF_INDEX, DefId}; -use middle::ty::{self, TyCtxt}; +use ty::{self, TyCtxt}; use middle::privacy::AccessLevels; use syntax::parse::token::InternedString; use syntax::codemap::{Span, DUMMY_SP}; diff --git a/src/librustc/mir/repr.rs b/src/librustc/mir/repr.rs index 47d923cbce3..b9073810783 100644 --- a/src/librustc/mir/repr.rs +++ b/src/librustc/mir/repr.rs @@ -12,8 +12,8 @@ use graphviz::IntoCow; use middle::const_eval::ConstVal; use rustc_const_eval::{ConstUsize, ConstInt}; use middle::def_id::DefId; -use middle::subst::Substs; -use middle::ty::{self, AdtDef, ClosureSubsts, FnOutput, Region, Ty}; +use ty::subst::Substs; +use ty::{self, AdtDef, ClosureSubsts, FnOutput, Region, Ty}; use util::ppaux; use rustc_back::slice; use rustc_front::hir::InlineAsm; diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index c8a2bc440ce..46d99dbef8c 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -14,9 +14,9 @@ */ use mir::repr::*; -use middle::subst::{Subst, Substs}; -use middle::ty::{self, AdtDef, Ty, TyCtxt}; -use middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; +use ty::subst::{Subst, Substs}; +use ty::{self, AdtDef, Ty, TyCtxt}; +use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use rustc_front::hir; #[derive(Copy, Clone, Debug)] diff --git a/src/librustc/mir/transform.rs b/src/librustc/mir/transform.rs index afcb5b95631..410e3f9d066 100644 --- a/src/librustc/mir/transform.rs +++ b/src/librustc/mir/transform.rs @@ -10,7 +10,7 @@ use mir::mir_map::MirMap; use mir::repr::Mir; -use middle::ty::TyCtxt; +use ty::TyCtxt; use syntax::ast::NodeId; /// Various information about pass. diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 8c180ecb233..856902bea3c 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -10,8 +10,8 @@ use middle::const_eval::ConstVal; use middle::def_id::DefId; -use middle::subst::Substs; -use middle::ty::{ClosureSubsts, FnOutput, Region, Ty}; +use ty::subst::Substs; +use ty::{ClosureSubsts, FnOutput, Region, Ty}; use mir::repr::*; use rustc_const_eval::ConstUsize; use rustc_data_structures::tuple_slice::TupleSlice; diff --git a/src/librustc/middle/traits/README.md b/src/librustc/traits/README.md similarity index 100% rename from src/librustc/middle/traits/README.md rename to src/librustc/traits/README.md diff --git a/src/librustc/middle/traits/coherence.rs b/src/librustc/traits/coherence.rs similarity index 98% rename from src/librustc/middle/traits/coherence.rs rename to src/librustc/traits/coherence.rs index 64d1c992cbf..b5b5da62080 100644 --- a/src/librustc/middle/traits/coherence.rs +++ b/src/librustc/traits/coherence.rs @@ -14,9 +14,9 @@ use super::{SelectionContext, Obligation, ObligationCause}; use middle::cstore::LOCAL_CRATE; use middle::def_id::DefId; -use middle::subst::TypeSpace; -use middle::ty::{self, Ty, TyCtxt}; -use middle::infer::{self, InferCtxt, TypeOrigin}; +use ty::subst::TypeSpace; +use ty::{self, Ty, TyCtxt}; +use infer::{self, InferCtxt, TypeOrigin}; use syntax::codemap::DUMMY_SP; #[derive(Copy, Clone)] diff --git a/src/librustc/middle/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs similarity index 99% rename from src/librustc/middle/traits/error_reporting.rs rename to src/librustc/traits/error_reporting.rs index dd051471a4d..c26aaeaf143 100644 --- a/src/librustc/middle/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -25,9 +25,9 @@ use super::{ use fmt_macros::{Parser, Piece, Position}; use middle::def_id::DefId; -use middle::infer::InferCtxt; -use middle::ty::{self, ToPredicate, ToPolyTraitRef, TraitRef, Ty, TyCtxt, TypeFoldable}; -use middle::ty::fast_reject; +use infer::InferCtxt; +use ty::{self, ToPredicate, ToPolyTraitRef, TraitRef, Ty, TyCtxt, TypeFoldable}; +use ty::fast_reject; use util::nodemap::{FnvHashMap, FnvHashSet}; use std::cmp; diff --git a/src/librustc/middle/traits/fulfill.rs b/src/librustc/traits/fulfill.rs similarity index 99% rename from src/librustc/middle/traits/fulfill.rs rename to src/librustc/traits/fulfill.rs index b2ba8a7a5f9..321144126c9 100644 --- a/src/librustc/middle/traits/fulfill.rs +++ b/src/librustc/traits/fulfill.rs @@ -9,8 +9,8 @@ // except according to those terms. use dep_graph::DepGraph; -use middle::infer::InferCtxt; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable, ToPolyTraitRef}; +use infer::InferCtxt; +use ty::{self, Ty, TyCtxt, TypeFoldable, ToPolyTraitRef}; use rustc_data_structures::obligation_forest::{Backtrace, ObligationForest, Error}; use std::iter; use syntax::ast; diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/traits/mod.rs similarity index 99% rename from src/librustc/middle/traits/mod.rs rename to src/librustc/traits/mod.rs index 5f66e9e6344..867bd054fa9 100644 --- a/src/librustc/middle/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -17,9 +17,9 @@ pub use self::ObligationCauseCode::*; use middle::def_id::DefId; use middle::free_region::FreeRegionMap; -use middle::subst; -use middle::ty::{self, Ty, TypeFoldable}; -use middle::infer::{self, fixup_err_to_string, InferCtxt}; +use ty::subst; +use ty::{self, Ty, TypeFoldable}; +use infer::{self, fixup_err_to_string, InferCtxt}; use std::rc::Rc; use syntax::ast; diff --git a/src/librustc/middle/traits/object_safety.rs b/src/librustc/traits/object_safety.rs similarity index 99% rename from src/librustc/middle/traits/object_safety.rs rename to src/librustc/traits/object_safety.rs index 4a0da521eef..7cd2ac5938d 100644 --- a/src/librustc/middle/traits/object_safety.rs +++ b/src/librustc/traits/object_safety.rs @@ -21,9 +21,9 @@ use super::supertraits; use super::elaborate_predicates; use middle::def_id::DefId; -use middle::subst::{self, SelfSpace, TypeSpace}; -use middle::traits; -use middle::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; +use ty::subst::{self, SelfSpace, TypeSpace}; +use traits; +use ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; use std::rc::Rc; use syntax::ast; diff --git a/src/librustc/middle/traits/project.rs b/src/librustc/traits/project.rs similarity index 99% rename from src/librustc/middle/traits/project.rs rename to src/librustc/traits/project.rs index e86f3ed01a4..3adaf5fa6bb 100644 --- a/src/librustc/middle/traits/project.rs +++ b/src/librustc/traits/project.rs @@ -24,10 +24,10 @@ use super::VtableImplData; use super::util; use middle::def_id::DefId; -use middle::infer::{self, TypeOrigin}; -use middle::subst::Subst; -use middle::ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt}; -use middle::ty::fold::{TypeFoldable, TypeFolder}; +use infer::{self, TypeOrigin}; +use ty::subst::Subst; +use ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt}; +use ty::fold::{TypeFoldable, TypeFolder}; use syntax::parse::token; use syntax::ast; use util::common::FN_OUTPUT_NAME; diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/traits/select.rs similarity index 99% rename from src/librustc/middle/traits/select.rs rename to src/librustc/traits/select.rs index 3eaf123e5be..e2a48688d4b 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -37,13 +37,13 @@ use super::object_safety; use super::util; use middle::def_id::DefId; -use middle::infer; -use middle::infer::{InferCtxt, TypeFreshener, TypeOrigin}; -use middle::subst::{Subst, Substs, TypeSpace}; -use middle::ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; -use middle::traits; -use middle::ty::fast_reject; -use middle::ty::relate::TypeRelation; +use infer; +use infer::{InferCtxt, TypeFreshener, TypeOrigin}; +use ty::subst::{Subst, Substs, TypeSpace}; +use ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; +use traits; +use ty::fast_reject; +use ty::relate::TypeRelation; use std::cell::RefCell; use std::fmt; diff --git a/src/librustc/middle/traits/specialize/mod.rs b/src/librustc/traits/specialize/mod.rs similarity index 98% rename from src/librustc/middle/traits/specialize/mod.rs rename to src/librustc/traits/specialize/mod.rs index 92478f2874e..e0ce54115eb 100644 --- a/src/librustc/middle/traits/specialize/mod.rs +++ b/src/librustc/traits/specialize/mod.rs @@ -22,11 +22,11 @@ use super::util::{fresh_type_vars_for_impl, impl_trait_ref_and_oblig}; use middle::cstore::CrateStore; use middle::def_id::DefId; -use middle::infer::{self, InferCtxt, TypeOrigin}; +use infer::{self, InferCtxt, TypeOrigin}; use middle::region; -use middle::subst::{Subst, Substs}; -use middle::traits::{self, ProjectionMode, ObligationCause, Normalized}; -use middle::ty::{self, TyCtxt}; +use ty::subst::{Subst, Substs}; +use traits::{self, ProjectionMode, ObligationCause, Normalized}; +use ty::{self, TyCtxt}; use syntax::codemap::DUMMY_SP; pub mod specialization_graph; diff --git a/src/librustc/middle/traits/specialize/specialization_graph.rs b/src/librustc/traits/specialize/specialization_graph.rs similarity index 99% rename from src/librustc/middle/traits/specialize/specialization_graph.rs rename to src/librustc/traits/specialize/specialization_graph.rs index f2170f75a11..eaafeb1a969 100644 --- a/src/librustc/middle/traits/specialize/specialization_graph.rs +++ b/src/librustc/traits/specialize/specialization_graph.rs @@ -15,9 +15,9 @@ use super::{Overlap, specializes}; use middle::cstore::CrateStore; use middle::def_id::DefId; -use middle::infer; -use middle::traits::{self, ProjectionMode}; -use middle::ty::{self, TyCtxt, ImplOrTraitItem, TraitDef, TypeFoldable}; +use infer; +use traits::{self, ProjectionMode}; +use ty::{self, TyCtxt, ImplOrTraitItem, TraitDef, TypeFoldable}; use syntax::ast::Name; use util::nodemap::DefIdMap; diff --git a/src/librustc/middle/traits/structural_impls.rs b/src/librustc/traits/structural_impls.rs similarity index 98% rename from src/librustc/middle/traits/structural_impls.rs rename to src/librustc/traits/structural_impls.rs index 903b7c80baf..367e5f32ba3 100644 --- a/src/librustc/middle/traits/structural_impls.rs +++ b/src/librustc/traits/structural_impls.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::traits; -use middle::traits::project::Normalized; -use middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; +use traits; +use traits::project::Normalized; +use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use std::fmt; -// structural impls for the structs in middle::traits +// structural impls for the structs in traits impl<'tcx, T: fmt::Debug> fmt::Debug for Normalized<'tcx, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/librustc/middle/traits/util.rs b/src/librustc/traits/util.rs similarity index 99% rename from src/librustc/middle/traits/util.rs rename to src/librustc/traits/util.rs index 9f984bc1fc6..f339b6e50ce 100644 --- a/src/librustc/middle/traits/util.rs +++ b/src/librustc/traits/util.rs @@ -9,9 +9,9 @@ // except according to those terms. use middle::def_id::DefId; -use middle::infer::InferCtxt; -use middle::subst::{Subst, Substs}; -use middle::ty::{self, Ty, TyCtxt, ToPredicate, ToPolyTraitRef}; +use infer::InferCtxt; +use ty::subst::{Subst, Substs}; +use ty::{self, Ty, TyCtxt, ToPredicate, ToPolyTraitRef}; use syntax::codemap::Span; use util::common::ErrorReported; use util::nodemap::FnvHashSet; diff --git a/src/librustc/middle/ty/_match.rs b/src/librustc/ty/_match.rs similarity index 96% rename from src/librustc/middle/ty/_match.rs rename to src/librustc/ty/_match.rs index fe54334da3d..d0ccc3e0fdd 100644 --- a/src/librustc/middle/ty/_match.rs +++ b/src/librustc/ty/_match.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::error::TypeError; -use middle::ty::relate::{self, Relate, TypeRelation, RelateResult}; +use ty::{self, Ty, TyCtxt}; +use ty::error::TypeError; +use ty::relate::{self, Relate, TypeRelation, RelateResult}; /// A type "A" *matches* "B" if the fresh types in B could be /// substituted with values so as to make it equal to A. Matching is diff --git a/src/librustc/middle/ty/adjustment.rs b/src/librustc/ty/adjustment.rs similarity index 98% rename from src/librustc/middle/ty/adjustment.rs rename to src/librustc/ty/adjustment.rs index e4c293a74e8..dc2117b1ad1 100644 --- a/src/librustc/middle/ty/adjustment.rs +++ b/src/librustc/ty/adjustment.rs @@ -11,8 +11,8 @@ pub use self::AutoAdjustment::*; pub use self::AutoRef::*; -use middle::ty::{self, Ty, TyCtxt, TypeAndMut, TypeFoldable}; -use middle::ty::LvaluePreference::{NoPreference}; +use ty::{self, Ty, TyCtxt, TypeAndMut, TypeFoldable}; +use ty::LvaluePreference::{NoPreference}; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc/middle/ty/cast.rs b/src/librustc/ty/cast.rs similarity index 98% rename from src/librustc/middle/ty/cast.rs rename to src/librustc/ty/cast.rs index b25d6e0476d..c8d282d18af 100644 --- a/src/librustc/middle/ty/cast.rs +++ b/src/librustc/ty/cast.rs @@ -11,7 +11,7 @@ // Helpers for handling cast expressions, used in both // typeck and trans. -use middle::ty::{self, Ty}; +use ty::{self, Ty}; use syntax::ast; diff --git a/src/librustc/middle/ty/contents.rs b/src/librustc/ty/contents.rs similarity index 99% rename from src/librustc/middle/ty/contents.rs rename to src/librustc/ty/contents.rs index 47a15a14b41..cb84b198222 100644 --- a/src/librustc/middle/ty/contents.rs +++ b/src/librustc/ty/contents.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::def_id::{DefId}; -use middle::ty::{self, Ty, TyCtxt}; +use ty::{self, Ty, TyCtxt}; use util::common::MemoizationMap; use util::nodemap::FnvHashMap; diff --git a/src/librustc/middle/ty/context.rs b/src/librustc/ty/context.rs similarity index 98% rename from src/librustc/middle/ty/context.rs rename to src/librustc/ty/context.rs index 6acd094c1f9..49e9eda5651 100644 --- a/src/librustc/middle/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -22,16 +22,16 @@ use middle::free_region::FreeRegionMap; use middle::region::RegionMaps; use middle::resolve_lifetime; use middle::stability; -use middle::subst::{self, Subst, Substs}; -use middle::traits; -use middle::ty::{self, TraitRef, Ty, TypeAndMut}; -use middle::ty::{TyS, TypeVariants}; -use middle::ty::{AdtDef, ClosureSubsts, ExistentialBounds, Region}; -use middle::ty::{FreevarMap}; -use middle::ty::{BareFnTy, InferTy, ParamTy, ProjectionTy, TraitTy}; -use middle::ty::{TyVar, TyVid, IntVar, IntVid, FloatVar, FloatVid}; -use middle::ty::TypeVariants::*; -use middle::ty::maps; +use ty::subst::{self, Subst, Substs}; +use traits; +use ty::{self, TraitRef, Ty, TypeAndMut}; +use ty::{TyS, TypeVariants}; +use ty::{AdtDef, ClosureSubsts, ExistentialBounds, Region}; +use ty::{FreevarMap}; +use ty::{BareFnTy, InferTy, ParamTy, ProjectionTy, TraitTy}; +use ty::{TyVar, TyVid, IntVar, IntVid, FloatVar, FloatVid}; +use ty::TypeVariants::*; +use ty::maps; use util::common::MemoizationMap; use util::nodemap::{NodeMap, NodeSet, DefIdMap, DefIdSet}; use util::nodemap::FnvHashMap; @@ -639,7 +639,7 @@ impl<'a, 'tcx> Lift<'tcx> for &'a Substs<'a> { pub mod tls { - use middle::ty::TyCtxt; + use ty::TyCtxt; use std::cell::Cell; use std::fmt; @@ -699,7 +699,7 @@ macro_rules! sty_debug_print { // variable names. #[allow(non_snake_case)] mod inner { - use middle::ty::{self, TyCtxt}; + use ty::{self, TyCtxt}; #[derive(Copy, Clone)] struct DebugStat { total: usize, diff --git a/src/librustc/middle/ty/error.rs b/src/librustc/ty/error.rs similarity index 99% rename from src/librustc/middle/ty/error.rs rename to src/librustc/ty/error.rs index 1033af5f331..9ab48505828 100644 --- a/src/librustc/middle/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -9,9 +9,9 @@ // except according to those terms. use middle::def_id::DefId; -use middle::subst; -use middle::infer::type_variable; -use middle::ty::{self, BoundRegion, Region, Ty, TyCtxt}; +use ty::subst; +use infer::type_variable; +use ty::{self, BoundRegion, Region, Ty, TyCtxt}; use std::fmt; use syntax::abi; diff --git a/src/librustc/middle/ty/fast_reject.rs b/src/librustc/ty/fast_reject.rs similarity index 99% rename from src/librustc/middle/ty/fast_reject.rs rename to src/librustc/ty/fast_reject.rs index fc4db22a8a6..0865e059f59 100644 --- a/src/librustc/middle/ty/fast_reject.rs +++ b/src/librustc/ty/fast_reject.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::def_id::DefId; -use middle::ty::{self, Ty, TyCtxt}; +use ty::{self, Ty, TyCtxt}; use syntax::ast; use self::SimplifiedType::*; diff --git a/src/librustc/middle/ty/flags.rs b/src/librustc/ty/flags.rs similarity index 98% rename from src/librustc/middle/ty/flags.rs rename to src/librustc/ty/flags.rs index c874e9b7ca5..f3dcccedc59 100644 --- a/src/librustc/middle/ty/flags.rs +++ b/src/librustc/ty/flags.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::subst; -use middle::ty::{self, Ty, TypeFlags, TypeFoldable}; +use ty::subst; +use ty::{self, Ty, TypeFlags, TypeFoldable}; pub struct FlagComputation { pub flags: TypeFlags, diff --git a/src/librustc/middle/ty/fold.rs b/src/librustc/ty/fold.rs similarity index 99% rename from src/librustc/middle/ty/fold.rs rename to src/librustc/ty/fold.rs index f754e5c5a0a..d04f272688c 100644 --- a/src/librustc/middle/ty/fold.rs +++ b/src/librustc/ty/fold.rs @@ -40,9 +40,9 @@ //! and does not need to visit anything else. use middle::region; -use middle::subst; -use middle::ty::adjustment; -use middle::ty::{self, Binder, Ty, TyCtxt, TypeFlags}; +use ty::subst; +use ty::adjustment; +use ty::{self, Binder, Ty, TyCtxt, TypeFlags}; use std::fmt; use util::nodemap::{FnvHashMap, FnvHashSet}; diff --git a/src/librustc/middle/ty/item_path.rs b/src/librustc/ty/item_path.rs similarity index 99% rename from src/librustc/middle/ty/item_path.rs rename to src/librustc/ty/item_path.rs index 147230f5bdc..a106fd6e5aa 100644 --- a/src/librustc/middle/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -11,7 +11,7 @@ use front::map::DefPathData; use middle::cstore::LOCAL_CRATE; use middle::def_id::DefId; -use middle::ty::{self, Ty, TyCtxt}; +use ty::{self, Ty, TyCtxt}; use syntax::ast; impl<'tcx> TyCtxt<'tcx> { diff --git a/src/librustc/middle/ty/ivar.rs b/src/librustc/ty/ivar.rs similarity index 98% rename from src/librustc/middle/ty/ivar.rs rename to src/librustc/ty/ivar.rs index ffc12aa5aea..b0f443fc19b 100644 --- a/src/librustc/middle/ty/ivar.rs +++ b/src/librustc/ty/ivar.rs @@ -9,8 +9,8 @@ // except according to those terms. use dep_graph::DepNode; -use middle::ty::{Ty, TyS}; -use middle::ty::tls; +use ty::{Ty, TyS}; +use ty::tls; use rustc_data_structures::ivar; diff --git a/src/librustc/middle/ty/maps.rs b/src/librustc/ty/maps.rs similarity index 99% rename from src/librustc/middle/ty/maps.rs rename to src/librustc/ty/maps.rs index 8d8afc199f5..77b6b03e48f 100644 --- a/src/librustc/middle/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -10,7 +10,7 @@ use dep_graph::{DepNode, DepTrackingMapConfig}; use middle::def_id::DefId; -use middle::ty; +use ty; use std::marker::PhantomData; use std::rc::Rc; use syntax::{attr, ast}; diff --git a/src/librustc/middle/ty/mod.rs b/src/librustc/ty/mod.rs similarity index 99% rename from src/librustc/middle/ty/mod.rs rename to src/librustc/ty/mod.rs index a4c3e82b633..96a0627c6a4 100644 --- a/src/librustc/middle/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -27,11 +27,11 @@ use middle::def::{self, Def, ExportMap}; use middle::def_id::DefId; use middle::lang_items::{FnTraitLangItem, FnMutTraitLangItem, FnOnceTraitLangItem}; use middle::region::{CodeExtent}; -use middle::subst::{self, Subst, Substs, VecPerParamSpace}; -use middle::traits; -use middle::ty; -use middle::ty::fold::TypeFolder; -use middle::ty::walk::TypeWalker; +use traits; +use ty; +use ty::fold::TypeFolder; +use ty::subst::{Subst, Substs, VecPerParamSpace}; +use ty::walk::TypeWalker; use util::common::MemoizationMap; use util::nodemap::{NodeMap, NodeSet}; use util::nodemap::FnvHashMap; @@ -91,6 +91,7 @@ pub mod _match; pub mod maps; pub mod outlives; pub mod relate; +pub mod subst; pub mod trait_def; pub mod walk; pub mod wf; diff --git a/src/librustc/middle/ty/outlives.rs b/src/librustc/ty/outlives.rs similarity index 99% rename from src/librustc/middle/ty/outlives.rs rename to src/librustc/ty/outlives.rs index 9439180a6cd..898c9d65c78 100644 --- a/src/librustc/middle/ty/outlives.rs +++ b/src/librustc/ty/outlives.rs @@ -12,8 +12,8 @@ // refers to rules defined in RFC 1214 (`OutlivesFooBar`), so see that // RFC for reference. -use middle::infer::InferCtxt; -use middle::ty::{self, Ty, TypeFoldable}; +use infer::InferCtxt; +use ty::{self, Ty, TypeFoldable}; #[derive(Debug)] pub enum Component<'tcx> { diff --git a/src/librustc/middle/ty/relate.rs b/src/librustc/ty/relate.rs similarity index 99% rename from src/librustc/middle/ty/relate.rs rename to src/librustc/ty/relate.rs index 563ff346a64..bb4f13b13c1 100644 --- a/src/librustc/middle/ty/relate.rs +++ b/src/librustc/ty/relate.rs @@ -14,9 +14,9 @@ //! type equality, etc. use middle::def_id::DefId; -use middle::subst::{ParamSpace, Substs}; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; -use middle::ty::error::{ExpectedFound, TypeError}; +use ty::subst::{ParamSpace, Substs}; +use ty::{self, Ty, TyCtxt, TypeFoldable}; +use ty::error::{ExpectedFound, TypeError}; use std::rc::Rc; use syntax::abi; use rustc_front::hir as ast; diff --git a/src/librustc/middle/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs similarity index 99% rename from src/librustc/middle/ty/structural_impls.rs rename to src/librustc/ty/structural_impls.rs index 0358fa2f124..6fca1eef701 100644 --- a/src/librustc/middle/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::subst::{self, VecPerParamSpace}; -use middle::traits; -use middle::ty::{self, Lift, TraitRef, Ty, TyCtxt}; -use middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; +use ty::subst::{self, VecPerParamSpace}; +use traits; +use ty::{self, Lift, TraitRef, Ty, TyCtxt}; +use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use std::rc::Rc; use syntax::abi; diff --git a/src/librustc/middle/ty/sty.rs b/src/librustc/ty/sty.rs similarity index 99% rename from src/librustc/middle/ty/sty.rs rename to src/librustc/ty/sty.rs index 7a17b24df5e..dae12824da2 100644 --- a/src/librustc/middle/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -13,9 +13,9 @@ use middle::cstore; use middle::def_id::DefId; use middle::region; -use middle::subst::{self, Substs}; -use middle::traits; -use middle::ty::{self, AdtDef, ToPredicate, TypeFlags, Ty, TyCtxt, TyS, TypeFoldable}; +use ty::subst::{self, Substs}; +use traits; +use ty::{self, AdtDef, ToPredicate, TypeFlags, Ty, TyCtxt, TyS, TypeFoldable}; use util::common::ErrorReported; use collections::enum_set::{self, EnumSet, CLike}; @@ -732,7 +732,7 @@ pub enum InferTy { /// A `FreshTy` is one that is generated as a replacement for an /// unbound type variable. This is convenient for caching etc. See - /// `middle::infer::freshen` for more details. + /// `infer::freshen` for more details. FreshTy(u32), FreshIntTy(u32), FreshFloatTy(u32) diff --git a/src/librustc/middle/subst.rs b/src/librustc/ty/subst.rs similarity index 99% rename from src/librustc/middle/subst.rs rename to src/librustc/ty/subst.rs index b9bf550704e..8d257282121 100644 --- a/src/librustc/middle/subst.rs +++ b/src/librustc/ty/subst.rs @@ -14,8 +14,8 @@ pub use self::ParamSpace::*; use middle::cstore; use middle::def_id::DefId; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::fold::{TypeFoldable, TypeFolder}; +use ty::{self, Ty, TyCtxt}; +use ty::fold::{TypeFoldable, TypeFolder}; use serialize::{Encodable, Encoder, Decodable, Decoder}; use std::fmt; diff --git a/src/librustc/middle/ty/trait_def.rs b/src/librustc/ty/trait_def.rs similarity index 98% rename from src/librustc/middle/ty/trait_def.rs rename to src/librustc/ty/trait_def.rs index 3d7b3bf2634..3ebf2ba4c84 100644 --- a/src/librustc/middle/ty/trait_def.rs +++ b/src/librustc/ty/trait_def.rs @@ -10,10 +10,10 @@ use dep_graph::DepNode; use middle::def_id::DefId; -use middle::traits::{self, specialization_graph}; -use middle::ty; -use middle::ty::fast_reject; -use middle::ty::{Ty, TyCtxt, TraitRef}; +use traits::{self, specialization_graph}; +use ty; +use ty::fast_reject; +use ty::{Ty, TyCtxt, TraitRef}; use std::borrow::{Borrow}; use std::cell::{Cell, Ref, RefCell}; use syntax::ast::Name; diff --git a/src/librustc/middle/ty/util.rs b/src/librustc/ty/util.rs similarity index 99% rename from src/librustc/middle/ty/util.rs rename to src/librustc/ty/util.rs index 6a91592dbd5..b870dc47ec7 100644 --- a/src/librustc/middle/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -14,13 +14,13 @@ use back::svh::Svh; use middle::const_eval::{self, ConstVal, ErrKind}; use middle::const_eval::EvalHint::UncheckedExprHint; use middle::def_id::DefId; -use middle::subst; -use middle::infer; +use ty::subst; +use infer; use middle::pat_util; -use middle::traits::{self, ProjectionMode}; -use middle::ty::{self, Ty, TyCtxt, TypeAndMut, TypeFlags, TypeFoldable}; -use middle::ty::{Disr, ParameterEnvironment}; -use middle::ty::TypeVariants::*; +use traits::{self, ProjectionMode}; +use ty::{self, Ty, TyCtxt, TypeAndMut, TypeFlags, TypeFoldable}; +use ty::{Disr, ParameterEnvironment}; +use ty::TypeVariants::*; use rustc_const_eval::{ConstInt, ConstIsize, ConstUsize}; diff --git a/src/librustc/middle/ty/walk.rs b/src/librustc/ty/walk.rs similarity index 99% rename from src/librustc/middle/ty/walk.rs rename to src/librustc/ty/walk.rs index b6d93ecf78b..fa7c9b78231 100644 --- a/src/librustc/middle/ty/walk.rs +++ b/src/librustc/ty/walk.rs @@ -11,7 +11,7 @@ //! An iterator over the type substructure. //! WARNING: this does not keep track of the region depth. -use middle::ty::{self, Ty}; +use ty::{self, Ty}; use std::iter::Iterator; use std::vec::IntoIter; diff --git a/src/librustc/middle/ty/wf.rs b/src/librustc/ty/wf.rs similarity index 99% rename from src/librustc/middle/ty/wf.rs rename to src/librustc/ty/wf.rs index 5f81d27a1f6..e6c4e90babb 100644 --- a/src/librustc/middle/ty/wf.rs +++ b/src/librustc/ty/wf.rs @@ -9,11 +9,11 @@ // except according to those terms. use middle::def_id::DefId; -use middle::infer::InferCtxt; -use middle::ty::outlives::{self, Component}; -use middle::subst::Substs; -use middle::traits; -use middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; +use infer::InferCtxt; +use ty::outlives::{self, Component}; +use ty::subst::Substs; +use traits; +use ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; use std::iter::once; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 6e7f49516e8..20f16a1d255 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -10,14 +10,14 @@ use middle::def_id::DefId; -use middle::subst::{self, Subst}; -use middle::ty::{BrAnon, BrEnv, BrFresh, BrNamed}; -use middle::ty::{TyBool, TyChar, TyStruct, TyEnum}; -use middle::ty::{TyError, TyStr, TyArray, TySlice, TyFloat, TyFnDef, TyFnPtr}; -use middle::ty::{TyParam, TyRawPtr, TyRef, TyTuple}; -use middle::ty::TyClosure; -use middle::ty::{TyBox, TyTrait, TyInt, TyUint, TyInfer}; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +use ty::subst::{self, Subst}; +use ty::{BrAnon, BrEnv, BrFresh, BrNamed}; +use ty::{TyBool, TyChar, TyStruct, TyEnum}; +use ty::{TyError, TyStr, TyArray, TySlice, TyFloat, TyFnDef, TyFnPtr}; +use ty::{TyParam, TyRawPtr, TyRef, TyTuple}; +use ty::TyClosure; +use ty::{TyBox, TyTrait, TyInt, TyUint, TyInfer}; +use ty::{self, Ty, TyCtxt, TypeFoldable}; use std::fmt; use syntax::abi::Abi; diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index 9186765e6d0..aa2b7ed2cde 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -22,12 +22,12 @@ use borrowck::*; use borrowck::InteriorKind::{InteriorElement, InteriorField}; use rustc::middle::expr_use_visitor as euv; use rustc::middle::expr_use_visitor::MutateMode; -use rustc::middle::infer; +use rustc::infer; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::middle::region; -use rustc::middle::ty::{self, TyCtxt}; -use rustc::middle::traits::ProjectionMode; +use rustc::ty::{self, TyCtxt}; +use rustc::traits::ProjectionMode; use syntax::ast; use syntax::codemap::Span; use rustc_front::hir; diff --git a/src/librustc_borrowck/borrowck/fragments.rs b/src/librustc_borrowck/borrowck/fragments.rs index 3d6e9c8868c..2d38b665cf9 100644 --- a/src/librustc_borrowck/borrowck/fragments.rs +++ b/src/librustc_borrowck/borrowck/fragments.rs @@ -21,7 +21,7 @@ use borrowck::LoanPathElem::{LpDeref, LpInterior}; use borrowck::move_data::InvalidMovePathIndex; use borrowck::move_data::{MoveData, MovePathIndex}; use rustc::middle::def_id::{DefId}; -use rustc::middle::ty::{self, TyCtxt}; +use rustc::ty::{self, TyCtxt}; use rustc::middle::mem_categorization as mc; use std::mem; diff --git a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs index 4e507284a1b..107109c9115 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs @@ -18,7 +18,7 @@ use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::middle::mem_categorization::InteriorOffsetKind as Kind; -use rustc::middle::ty; +use rustc::ty; use std::rc::Rc; use syntax::ast; diff --git a/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs b/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs index 84dce6d3570..c2492bba624 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs @@ -16,7 +16,7 @@ use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::middle::region; -use rustc::middle::ty; +use rustc::ty; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index 2d255c05454..247f8121de7 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -19,12 +19,12 @@ use borrowck::*; use borrowck::move_data::MoveData; use rustc::middle::expr_use_visitor as euv; -use rustc::middle::infer; +use rustc::infer; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::middle::region; -use rustc::middle::ty::{self, TyCtxt}; -use rustc::middle::traits::ProjectionMode; +use rustc::ty::{self, TyCtxt}; +use rustc::traits::ProjectionMode; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs index 4cb9673785e..f49554289b3 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs @@ -12,7 +12,7 @@ use borrowck::BorrowckCtxt; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::middle::mem_categorization::InteriorOffsetKind as Kind; -use rustc::middle::ty; +use rustc::ty; use syntax::ast; use syntax::codemap; use syntax::errors::DiagnosticBuilder; diff --git a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs index 2a0d8ef2766..ee8c3aff2ec 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs @@ -14,7 +14,7 @@ use borrowck::*; use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; -use rustc::middle::ty; +use rustc::ty; use syntax::codemap::Span; use borrowck::ToInteriorKind; diff --git a/src/librustc_borrowck/borrowck/mir/dataflow.rs b/src/librustc_borrowck/borrowck/mir/dataflow.rs index 3c3a60b995f..a8176c060a1 100644 --- a/src/librustc_borrowck/borrowck/mir/dataflow.rs +++ b/src/librustc_borrowck/borrowck/mir/dataflow.rs @@ -10,7 +10,7 @@ use syntax::attr::AttrMetaMethods; -use rustc::middle::ty; +use rustc::ty::TyCtxt; use rustc::mir::repr::{self, Mir}; use std::io; @@ -459,7 +459,7 @@ impl DataflowState { impl<'tcx> DataflowState> { - pub fn new_move_analysis(mir: &Mir<'tcx>, tcx: &ty::TyCtxt<'tcx>) -> Self { + pub fn new_move_analysis(mir: &Mir<'tcx>, tcx: &TyCtxt<'tcx>) -> Self { let move_data = MoveData::gather_moves(mir, tcx); DataflowState::new(mir, move_data) } diff --git a/src/librustc_borrowck/borrowck/mir/gather_moves.rs b/src/librustc_borrowck/borrowck/mir/gather_moves.rs index 46eb3d3ca03..dbe58799341 100644 --- a/src/librustc_borrowck/borrowck/mir/gather_moves.rs +++ b/src/librustc_borrowck/borrowck/mir/gather_moves.rs @@ -9,7 +9,7 @@ // except according to those terms. -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc::mir::repr::*; use rustc::util::nodemap::FnvHashMap; diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index bb2fe7acb95..d985359a3dd 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -23,7 +23,7 @@ use self::InteriorKind::*; use rustc::dep_graph::DepNode; use rustc::front::map as hir_map; use rustc::front::map::blocks::FnParts; -use rustc::middle::cfg; +use rustc::cfg; use rustc::middle::dataflow::DataFlowContext; use rustc::middle::dataflow::BitwiseOperator; use rustc::middle::dataflow::DataFlowOperator; @@ -34,7 +34,7 @@ use rustc::middle::free_region::FreeRegionMap; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::middle::region; -use rustc::middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::{self, Ty, TyCtxt}; use std::fmt; use std::mem; diff --git a/src/librustc_borrowck/borrowck/move_data.rs b/src/librustc_borrowck/borrowck/move_data.rs index 4c645d4bb69..00274fe1a04 100644 --- a/src/librustc_borrowck/borrowck/move_data.rs +++ b/src/librustc_borrowck/borrowck/move_data.rs @@ -14,14 +14,14 @@ pub use self::MoveKind::*; use borrowck::*; -use rustc::middle::cfg; +use rustc::cfg; use rustc::middle::dataflow::DataFlowContext; use rustc::middle::dataflow::BitwiseOperator; use rustc::middle::dataflow::DataFlowOperator; use rustc::middle::dataflow::KillFrom; use rustc::middle::expr_use_visitor as euv; use rustc::middle::expr_use_visitor::MutateMode; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc::util::nodemap::{FnvHashMap, NodeSet}; use std::cell::RefCell; diff --git a/src/librustc_borrowck/graphviz.rs b/src/librustc_borrowck/graphviz.rs index fd23772bcda..0da9525efd8 100644 --- a/src/librustc_borrowck/graphviz.rs +++ b/src/librustc_borrowck/graphviz.rs @@ -14,13 +14,13 @@ pub use self::Variant::*; -pub use rustc::middle::cfg::graphviz::{Node, Edge}; -use rustc::middle::cfg::graphviz as cfg_dot; +pub use rustc::cfg::graphviz::{Node, Edge}; +use rustc::cfg::graphviz as cfg_dot; use borrowck; use borrowck::{BorrowckCtxt, LoanPath}; use dot; -use rustc::middle::cfg::CFGIndex; +use rustc::cfg::CFGIndex; use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit}; use std::rc::Rc; use dot::IntoCow; diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index bf86e8f039a..c8c51793444 100644 --- a/src/librustc_driver/Cargo.toml +++ b/src/librustc_driver/Cargo.toml @@ -25,6 +25,7 @@ rustc_plugin = { path = "../librustc_plugin" } rustc_passes = { path = "../librustc_passes" } rustc_privacy = { path = "../librustc_privacy" } rustc_resolve = { path = "../librustc_resolve" } +rustc_save_analysis = { path = "../librustc_save_analysis" } rustc_trans = { path = "../librustc_trans" } rustc_typeck = { path = "../librustc_typeck" } rustc_metadata = { path = "../librustc_metadata" } diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 96e819ea91f..468dc7b12c1 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -17,9 +17,9 @@ use rustc::session::{Session, CompileResult, compile_result_from_err_count}; use rustc::session::config::{self, Input, OutputFilenames, OutputType}; use rustc::session::search_paths::PathKind; use rustc::lint; -use rustc::middle::{self, dependency_format, stability, ty, reachable}; +use rustc::middle::{self, dependency_format, stability, reachable}; use rustc::middle::privacy::AccessLevels; -use rustc::middle::ty::TyCtxt; +use rustc::ty::{self, TyCtxt}; use rustc::util::common::time; use rustc::util::nodemap::NodeSet; use rustc_back::sha2::{Sha256, Digest}; @@ -30,7 +30,7 @@ use rustc_metadata::creader::LocalCrateReader; use rustc_metadata::cstore::CStore; use rustc_trans::back::link; use rustc_trans::back::write; -use rustc_trans::trans; +use rustc_trans as trans; use rustc_typeck as typeck; use rustc_privacy; use rustc_plugin::registry::Registry; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 9ba6abb962e..d8d1cf5a026 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -48,6 +48,7 @@ extern crate rustc_privacy; extern crate rustc_metadata; extern crate rustc_mir; extern crate rustc_resolve; +extern crate rustc_save_analysis; extern crate rustc_trans; extern crate rustc_typeck; extern crate serialize; @@ -62,8 +63,8 @@ use driver::CompileController; use pretty::{PpMode, UserIdentifiedItem}; use rustc_resolve as resolve; +use rustc_save_analysis as save; use rustc_trans::back::link; -use rustc_trans::save; use rustc::session::{config, Session, build_session, CompileResult}; use rustc::session::config::{Input, PrintRequest, OutputType, ErrorOutputType}; use rustc::session::config::{get_unstable_features_setting, OptionStability}; diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 726dd02dd25..31345cfdc41 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -20,9 +20,9 @@ use rustc_trans::back::link; use {driver, abort_on_err}; use rustc::dep_graph::DepGraph; -use rustc::middle::ty::{self, TyCtxt}; -use rustc::middle::cfg; -use rustc::middle::cfg::graphviz::LabelledCFG; +use rustc::ty::{self, TyCtxt}; +use rustc::cfg; +use rustc::cfg::graphviz::LabelledCFG; use rustc::session::Session; use rustc::session::config::Input; use rustc_borrowck as borrowck; diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index 111db3b1d38..8620d5e1fd0 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -14,21 +14,21 @@ use driver; use rustc::dep_graph::DepGraph; use rustc_lint; use rustc_resolve as resolve; -use rustc_typeck::middle::lang_items; -use rustc_typeck::middle::free_region::FreeRegionMap; -use rustc_typeck::middle::region::{self, CodeExtent}; -use rustc_typeck::middle::region::CodeExtentData; -use rustc_typeck::middle::resolve_lifetime; -use rustc_typeck::middle::stability; -use rustc_typeck::middle::subst; -use rustc_typeck::middle::subst::Subst; -use rustc_typeck::middle::traits::ProjectionMode; -use rustc_typeck::middle::ty::{self, Ty, TyCtxt, TypeFoldable}; -use rustc_typeck::middle::ty::relate::TypeRelation; -use rustc_typeck::middle::infer::{self, TypeOrigin}; -use rustc_typeck::middle::infer::lub::Lub; -use rustc_typeck::middle::infer::glb::Glb; -use rustc_typeck::middle::infer::sub::Sub; +use rustc::middle::lang_items; +use rustc::middle::free_region::FreeRegionMap; +use rustc::middle::region::{self, CodeExtent}; +use rustc::middle::region::CodeExtentData; +use rustc::middle::resolve_lifetime; +use rustc::middle::stability; +use rustc::ty::subst; +use rustc::ty::subst::Subst; +use rustc::traits::ProjectionMode; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; +use rustc::ty::relate::TypeRelation; +use rustc::infer::{self, TypeOrigin}; +use rustc::infer::lub::Lub; +use rustc::infer::glb::Glb; +use rustc::infer::sub::Sub; use rustc_metadata::cstore::CStore; use rustc::front::map as hir_map; use rustc::session::{self, config}; diff --git a/src/librustc_lint/bad_style.rs b/src/librustc_lint/bad_style.rs index e399270197e..66d435a7581 100644 --- a/src/librustc_lint/bad_style.rs +++ b/src/librustc_lint/bad_style.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::def::Def; -use middle::ty; +use rustc::ty; use lint::{LateContext, LintContext, LintArray}; use lint::{LintPass, LateLintPass}; diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 2ccb905b6ec..339c969b01f 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -28,14 +28,15 @@ //! Use the former for unit-like structs and the latter for structs with //! a `pub fn new()`. -use middle::{cfg, infer, stability, traits}; use middle::def::Def; use middle::cstore::CrateStore; use middle::def_id::DefId; -use middle::subst::Substs; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::adjustment; -use middle::traits::ProjectionMode; +use middle::stability; +use rustc::{cfg, infer}; +use rustc::ty::subst::Substs; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::adjustment; +use rustc::traits::{self, ProjectionMode}; use rustc::front::map as hir_map; use util::nodemap::{NodeSet}; use lint::{Level, LateContext, LintContext, LintArray, Lint}; diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 1a84afab86b..6322f592573 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -10,10 +10,10 @@ #![allow(non_snake_case)] -use middle::{infer}; use middle::def_id::DefId; -use middle::subst::Substs; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::infer; +use rustc::ty::subst::Substs; +use rustc::ty::{self, Ty, TyCtxt}; use middle::const_eval::{eval_const_expr_partial, ConstVal}; use middle::const_eval::EvalHint::ExprTypeChecked; use util::nodemap::{FnvHashSet}; diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 36ed06a6c00..9840cd4256f 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -9,8 +9,8 @@ // except according to those terms. use middle::pat_util; -use middle::ty; -use middle::ty::adjustment; +use rustc::ty; +use rustc::ty::adjustment; use util::nodemap::FnvHashMap; use lint::{LateContext, EarlyContext, LintContext, LintArray}; use lint::{LintPass, EarlyLintPass, LateLintPass}; diff --git a/src/librustc_metadata/astencode.rs b/src/librustc_metadata/astencode.rs index 60f71107646..60865888a54 100644 --- a/src/librustc_metadata/astencode.rs +++ b/src/librustc_metadata/astencode.rs @@ -27,14 +27,14 @@ use tydecode; use tyencode; use middle::cstore::{InlinedItem, InlinedItemRef}; -use middle::ty::adjustment; -use middle::ty::cast; +use rustc::ty::adjustment; +use rustc::ty::cast; use middle::const_qualif::ConstQualif; use middle::def::{self, Def}; use middle::def_id::DefId; use middle::region; -use middle::subst; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::subst; +use rustc::ty::{self, Ty, TyCtxt}; use syntax::{ast, ast_util, codemap}; use syntax::ast::NodeIdAssigner; diff --git a/src/librustc_metadata/csearch.rs b/src/librustc_metadata/csearch.rs index 25cc2f91753..b1142393268 100644 --- a/src/librustc_metadata/csearch.rs +++ b/src/librustc_metadata/csearch.rs @@ -17,7 +17,7 @@ use middle::cstore::{CrateStore, CrateSource, ChildItem, ExternCrate, FoundAst}; use middle::cstore::{NativeLibraryKind, LinkMeta, LinkagePreference}; use middle::def; use middle::lang_items; -use middle::ty::{self, Ty, TyCtxt, VariantKind}; +use rustc::ty::{self, Ty, TyCtxt, VariantKind}; use middle::def_id::{DefId, DefIndex}; use rustc::front::map as hir_map; diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index a4eeee44fb7..e6f516ccd33 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -32,9 +32,9 @@ use middle::cstore::{DefLike, DlDef, DlField, DlImpl, tls}; use middle::def::Def; use middle::def_id::{DefId, DefIndex}; use middle::lang_items; -use middle::subst; -use middle::ty::{ImplContainer, TraitContainer}; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable, VariantKind}; +use rustc::ty::subst; +use rustc::ty::{ImplContainer, TraitContainer}; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable, VariantKind}; use rustc_const_eval::ConstInt; diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 73ac64adbb2..0a23cdee23d 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -25,10 +25,10 @@ use middle::def; use middle::def_id::{CRATE_DEF_INDEX, DefId}; use middle::dependency_format::Linkage; use middle::stability; -use middle::subst; -use middle::traits::specialization_graph; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::util::IntTypeExt; +use rustc::ty::subst; +use rustc::traits::specialization_graph; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::util::IntTypeExt; use rustc::back::svh::Svh; use rustc::front::map::{LinkedPath, PathElem, PathElems}; diff --git a/src/librustc_metadata/tls_context.rs b/src/librustc_metadata/tls_context.rs index f90abd9e1d9..6ecd7a7f50a 100644 --- a/src/librustc_metadata/tls_context.rs +++ b/src/librustc_metadata/tls_context.rs @@ -15,8 +15,8 @@ use rbml::opaque::Encoder as OpaqueEncoder; use rbml::opaque::Decoder as OpaqueDecoder; use rustc::middle::cstore::tls; use rustc::middle::def_id::DefId; -use rustc::middle::subst::Substs; -use rustc::middle::ty::{self, TyCtxt}; +use rustc::ty::subst::Substs; +use rustc::ty::{self, TyCtxt}; use decoder::{self, Cmd}; use encoder; diff --git a/src/librustc_metadata/tydecode.rs b/src/librustc_metadata/tydecode.rs index cd9c2e828bd..ed59fce77a0 100644 --- a/src/librustc_metadata/tydecode.rs +++ b/src/librustc_metadata/tydecode.rs @@ -20,9 +20,9 @@ use rustc_front::hir; use middle::def_id::{DefId, DefIndex}; use middle::region; -use middle::subst; -use middle::subst::VecPerParamSpace; -use middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; +use rustc::ty::subst; +use rustc::ty::subst::VecPerParamSpace; +use rustc::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; use rbml; use rbml::leb128; diff --git a/src/librustc_metadata/tyencode.rs b/src/librustc_metadata/tyencode.rs index 67e77ba3315..1d57918d173 100644 --- a/src/librustc_metadata/tyencode.rs +++ b/src/librustc_metadata/tyencode.rs @@ -19,10 +19,10 @@ use std::io::prelude::*; use middle::def_id::DefId; use middle::region; -use middle::subst; -use middle::subst::VecPerParamSpace; -use middle::ty::ParamTy; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::subst; +use rustc::ty::subst::VecPerParamSpace; +use rustc::ty::ParamTy; +use rustc::ty::{self, Ty, TyCtxt}; use rustc::util::nodemap::FnvHashMap; use rustc_front::hir; diff --git a/src/librustc_mir/build/expr/into.rs b/src/librustc_mir/build/expr/into.rs index 30c039cdde0..231d7da10a0 100644 --- a/src/librustc_mir/build/expr/into.rs +++ b/src/librustc_mir/build/expr/into.rs @@ -15,7 +15,7 @@ use build::expr::category::{Category, RvalueFunc}; use build::scope::LoopScope; use hair::*; use rustc::middle::region::CodeExtent; -use rustc::middle::ty; +use rustc::ty; use rustc::mir::repr::*; use syntax::codemap::Span; diff --git a/src/librustc_mir/build/matches/mod.rs b/src/librustc_mir/build/matches/mod.rs index b1286e935b6..581e8e35ee8 100644 --- a/src/librustc_mir/build/matches/mod.rs +++ b/src/librustc_mir/build/matches/mod.rs @@ -16,7 +16,7 @@ use build::{BlockAnd, BlockAndExtension, Builder}; use rustc_data_structures::fnv::FnvHashMap; use rustc::middle::const_eval::ConstVal; -use rustc::middle::ty::{AdtDef, Ty}; +use rustc::ty::{AdtDef, Ty}; use rustc::mir::repr::*; use hair::*; use syntax::ast::{Name, NodeId}; diff --git a/src/librustc_mir/build/matches/test.rs b/src/librustc_mir/build/matches/test.rs index 3211e5849a0..5a1c3739ef5 100644 --- a/src/librustc_mir/build/matches/test.rs +++ b/src/librustc_mir/build/matches/test.rs @@ -20,7 +20,7 @@ use build::matches::{Candidate, MatchPair, Test, TestKind}; use hair::*; use rustc_data_structures::fnv::FnvHashMap; use rustc::middle::const_eval::ConstVal; -use rustc::middle::ty::{self, Ty}; +use rustc::ty::{self, Ty}; use rustc::mir::repr::*; use syntax::codemap::Span; diff --git a/src/librustc_mir/build/misc.rs b/src/librustc_mir/build/misc.rs index 0d169078330..86f15a63193 100644 --- a/src/librustc_mir/build/misc.rs +++ b/src/librustc_mir/build/misc.rs @@ -12,7 +12,7 @@ //! kind of thing. use build::Builder; -use rustc::middle::ty::Ty; +use rustc::ty::Ty; use rustc::mir::repr::*; use std::u32; use syntax::codemap::Span; diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index b79f492179f..82f7ddebf0b 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -10,7 +10,7 @@ use hair::cx::Cx; use rustc::middle::region::{CodeExtent, CodeExtentData}; -use rustc::middle::ty::{FnOutput, Ty}; +use rustc::ty::{FnOutput, Ty}; use rustc::mir::repr::*; use rustc_data_structures::fnv::FnvHashMap; use rustc_front::hir; diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs index f5f6f409eab..bac7b310dc7 100644 --- a/src/librustc_mir/build/scope.rs +++ b/src/librustc_mir/build/scope.rs @@ -89,8 +89,8 @@ should go to. use build::{BlockAnd, BlockAndExtension, Builder, CFG, ScopeAuxiliary}; use rustc::middle::region::{CodeExtent, CodeExtentData}; use rustc::middle::lang_items; -use rustc::middle::subst::{Substs, Subst, VecPerParamSpace}; -use rustc::middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::subst::{Substs, Subst, VecPerParamSpace}; +use rustc::ty::{self, Ty, TyCtxt}; use rustc::mir::repr::*; use syntax::codemap::{Span, DUMMY_SP}; use syntax::parse::token::intern_and_get_ident; diff --git a/src/librustc_mir/graphviz.rs b/src/librustc_mir/graphviz.rs index a5e749ea687..959b1fdef52 100644 --- a/src/librustc_mir/graphviz.rs +++ b/src/librustc_mir/graphviz.rs @@ -10,7 +10,7 @@ use dot; use rustc::mir::repr::*; -use rustc::middle::ty; +use rustc::ty; use std::fmt::Debug; use std::io::{self, Write}; use syntax::ast::NodeId; diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index 4d87d926e40..aa55ee3e3f7 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -19,7 +19,7 @@ use rustc::middle::def::Def; use rustc::middle::const_eval::{self, ConstVal}; use rustc::middle::region::CodeExtent; use rustc::middle::pat_util; -use rustc::middle::ty::{self, VariantDef, Ty}; +use rustc::ty::{self, VariantDef, Ty}; use rustc::mir::repr::*; use rustc_front::hir; use rustc_front::util as hir_util; diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index b97bfaf5aef..30467a981d9 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -20,9 +20,9 @@ use rustc::mir::repr::*; use rustc::middle::const_eval::{self, ConstVal}; use rustc::middle::def_id::DefId; -use rustc::middle::infer::InferCtxt; -use rustc::middle::subst::{Subst, Substs}; -use rustc::middle::ty::{self, Ty, TyCtxt}; +use rustc::infer::InferCtxt; +use rustc::ty::subst::{Subst, Substs}; +use rustc::ty::{self, Ty, TyCtxt}; use syntax::codemap::Span; use syntax::parse::token; use rustc_front::hir; diff --git a/src/librustc_mir/hair/cx/pattern.rs b/src/librustc_mir/hair/cx/pattern.rs index a582a4622a6..0cb849555f2 100644 --- a/src/librustc_mir/hair/cx/pattern.rs +++ b/src/librustc_mir/hair/cx/pattern.rs @@ -14,7 +14,7 @@ use rustc_data_structures::fnv::FnvHashMap; use rustc::middle::const_eval; use rustc::middle::def::Def; use rustc::middle::pat_util::{pat_is_resolved_const, pat_is_binding}; -use rustc::middle::ty::{self, Ty}; +use rustc::ty::{self, Ty}; use rustc::mir::repr::*; use rustc_front::hir::{self, PatKind}; use syntax::ast; diff --git a/src/librustc_mir/hair/mod.rs b/src/librustc_mir/hair/mod.rs index 78c438df6f8..79c8356bb55 100644 --- a/src/librustc_mir/hair/mod.rs +++ b/src/librustc_mir/hair/mod.rs @@ -19,8 +19,8 @@ use rustc::mir::repr::{BinOp, BorrowKind, Field, Literal, Mutability, UnOp, use rustc::middle::const_eval::ConstVal; use rustc::middle::def_id::DefId; use rustc::middle::region::CodeExtent; -use rustc::middle::subst::Substs; -use rustc::middle::ty::{self, AdtDef, ClosureSubsts, Region, Ty}; +use rustc::ty::subst::Substs; +use rustc::ty::{self, AdtDef, ClosureSubsts, Region, Ty}; use rustc_front::hir; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_mir/mir_map.rs b/src/librustc_mir/mir_map.rs index 5a6e2edfdf9..21cc8d35320 100644 --- a/src/librustc_mir/mir_map.rs +++ b/src/librustc_mir/mir_map.rs @@ -26,9 +26,9 @@ use pretty; use hair::cx::Cx; use rustc::mir::mir_map::MirMap; -use rustc::middle::infer; -use rustc::middle::traits::ProjectionMode; -use rustc::middle::ty::{self, Ty, TyCtxt}; +use rustc::infer; +use rustc::traits::ProjectionMode; +use rustc::ty::{self, Ty, TyCtxt}; use rustc::util::common::ErrorReported; use rustc::util::nodemap::NodeMap; use rustc_front::hir; diff --git a/src/librustc_mir/pretty.rs b/src/librustc_mir/pretty.rs index 834897f8eae..2c50697c37f 100644 --- a/src/librustc_mir/pretty.rs +++ b/src/librustc_mir/pretty.rs @@ -10,7 +10,7 @@ use build::{Location, ScopeAuxiliaryVec}; use rustc::mir::repr::*; -use rustc::middle::ty::{self, TyCtxt}; +use rustc::ty::{self, TyCtxt}; use rustc_data_structures::fnv::FnvHashMap; use std::fmt::Display; use std::fs; diff --git a/src/librustc_mir/transform/erase_regions.rs b/src/librustc_mir/transform/erase_regions.rs index 6ea684c2f5c..12bfa3aebc2 100644 --- a/src/librustc_mir/transform/erase_regions.rs +++ b/src/librustc_mir/transform/erase_regions.rs @@ -12,8 +12,8 @@ //! We want to do this once just before trans, so trans does not have to take //! care erasing regions all over the place. -use rustc::middle::subst::Substs; -use rustc::middle::ty::{Ty, TyCtxt}; +use rustc::ty::subst::Substs; +use rustc::ty::{Ty, TyCtxt}; use rustc::mir::repr::*; use rustc::mir::visit::MutVisitor; use rustc::mir::transform::{MirPass, Pass}; diff --git a/src/librustc_mir/transform/no_landing_pads.rs b/src/librustc_mir/transform/no_landing_pads.rs index 0e9a1810787..edfe75b8430 100644 --- a/src/librustc_mir/transform/no_landing_pads.rs +++ b/src/librustc_mir/transform/no_landing_pads.rs @@ -11,7 +11,7 @@ //! This pass removes the unwind branch of all the terminators when the no-landing-pads option is //! specified. -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc::mir::repr::*; use rustc::mir::visit::MutVisitor; use rustc::mir::transform::{Pass, MirPass}; diff --git a/src/librustc_mir/transform/remove_dead_blocks.rs b/src/librustc_mir/transform/remove_dead_blocks.rs index 4513aeef86d..dc1ddad124f 100644 --- a/src/librustc_mir/transform/remove_dead_blocks.rs +++ b/src/librustc_mir/transform/remove_dead_blocks.rs @@ -33,7 +33,7 @@ //! and does not renumber anything. use rustc_data_structures::bitvec::BitVector; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc::mir::repr::*; use rustc::mir::transform::{Pass, MirPass}; use syntax::ast::NodeId; diff --git a/src/librustc_mir/transform/simplify_cfg.rs b/src/librustc_mir/transform/simplify_cfg.rs index 21b1d022fda..cbde292cb99 100644 --- a/src/librustc_mir/transform/simplify_cfg.rs +++ b/src/librustc_mir/transform/simplify_cfg.rs @@ -9,7 +9,7 @@ // except according to those terms. use rustc::middle::const_eval::ConstVal; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc::mir::repr::*; use rustc::mir::transform::{MirPass, Pass}; use pretty; diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index c0605ebe6d4..6cfde27ac97 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -12,10 +12,10 @@ #![allow(unreachable_code)] use rustc::dep_graph::DepNode; -use rustc::middle::infer::{self, InferCtxt}; -use rustc::middle::traits::{self, ProjectionMode}; -use rustc::middle::ty::fold::TypeFoldable; -use rustc::middle::ty::{self, Ty, TyCtxt}; +use rustc::infer::{self, InferCtxt}; +use rustc::traits::{self, ProjectionMode}; +use rustc::ty::fold::TypeFoldable; +use rustc::ty::{self, Ty, TyCtxt}; use rustc::mir::repr::*; use rustc::mir::tcx::LvalueTy; use rustc::mir::transform::{MirPass, Pass}; diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index c2b76459418..571d5bd9bc5 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -25,18 +25,18 @@ // by borrowck::gather_loans use rustc::dep_graph::DepNode; -use rustc::middle::ty::cast::{CastKind}; +use rustc::ty::cast::{CastKind}; use rustc::middle::const_eval::{self, ConstEvalErr}; use rustc::middle::const_eval::ErrKind::IndexOpFeatureGated; use rustc::middle::const_eval::EvalHint::ExprTypeChecked; use rustc::middle::def::Def; use rustc::middle::def_id::DefId; use rustc::middle::expr_use_visitor as euv; -use rustc::middle::infer; +use rustc::infer; use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; -use rustc::middle::ty::{self, Ty, TyCtxt}; -use rustc::middle::traits::{self, ProjectionMode}; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::traits::{self, ProjectionMode}; use rustc::util::nodemap::NodeMap; use rustc::middle::const_qualif::ConstQualif; use rustc::lint::builtin::CONST_ERR; diff --git a/src/librustc_passes/rvalues.rs b/src/librustc_passes/rvalues.rs index 88048b514e1..98502f5a16e 100644 --- a/src/librustc_passes/rvalues.rs +++ b/src/librustc_passes/rvalues.rs @@ -13,10 +13,10 @@ use rustc::dep_graph::DepNode; use rustc::middle::expr_use_visitor as euv; -use rustc::middle::infer; +use rustc::infer; use rustc::middle::mem_categorization as mc; -use rustc::middle::ty::{self, TyCtxt, ParameterEnvironment}; -use rustc::middle::traits::ProjectionMode; +use rustc::ty::{self, TyCtxt, ParameterEnvironment}; +use rustc::traits::ProjectionMode; use rustc_front::hir; use rustc_front::intravisit; diff --git a/src/librustc_platform_intrinsics/aarch64.rs b/src/librustc_platform_intrinsics/aarch64.rs index 59986a905a2..97fe632a529 100644 --- a/src/librustc_platform_intrinsics/aarch64.rs +++ b/src/librustc_platform_intrinsics/aarch64.rs @@ -15,7 +15,7 @@ use {Intrinsic, Type}; use IntrinsicDef::Named; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; // The default inlining settings trigger a pathological behaviour in // LLVM, which causes makes compilation very slow. See #28273. diff --git a/src/librustc_platform_intrinsics/arm.rs b/src/librustc_platform_intrinsics/arm.rs index d71f59e8e68..65751d65232 100644 --- a/src/librustc_platform_intrinsics/arm.rs +++ b/src/librustc_platform_intrinsics/arm.rs @@ -15,7 +15,7 @@ use {Intrinsic, Type}; use IntrinsicDef::Named; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; // The default inlining settings trigger a pathological behaviour in // LLVM, which causes makes compilation very slow. See #28273. diff --git a/src/librustc_platform_intrinsics/lib.rs b/src/librustc_platform_intrinsics/lib.rs index 53976308bdc..9736d558769 100644 --- a/src/librustc_platform_intrinsics/lib.rs +++ b/src/librustc_platform_intrinsics/lib.rs @@ -19,7 +19,7 @@ extern crate rustc_llvm as llvm; extern crate rustc; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; pub struct Intrinsic { pub inputs: &'static [&'static Type], diff --git a/src/librustc_platform_intrinsics/x86.rs b/src/librustc_platform_intrinsics/x86.rs index eccdc77f33c..de9d3dcf355 100644 --- a/src/librustc_platform_intrinsics/x86.rs +++ b/src/librustc_platform_intrinsics/x86.rs @@ -15,7 +15,7 @@ use {Intrinsic, Type}; use IntrinsicDef::Named; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; // The default inlining settings trigger a pathological behaviour in // LLVM, which causes makes compilation very slow. See #28273. diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 79ccc8fb2b2..304932df412 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -42,7 +42,7 @@ use rustc::middle::cstore::CrateStore; use rustc::middle::def::{self, Def}; use rustc::middle::def_id::DefId; use rustc::middle::privacy::{AccessLevel, AccessLevels}; -use rustc::middle::ty::{self, TyCtxt}; +use rustc::ty::{self, TyCtxt}; use rustc::util::nodemap::{NodeMap, NodeSet}; use rustc::front::map as ast_map; diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index fac79eb8a28..211bff352fe 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -26,7 +26,7 @@ use {resolve_error, resolve_struct_error, ResolutionError}; use rustc::middle::cstore::{CrateStore, ChildItem, DlDef}; use rustc::middle::def::*; use rustc::middle::def_id::{CRATE_DEF_INDEX, DefId}; -use rustc::middle::ty::VariantKind; +use rustc::ty::VariantKind; use syntax::ast::{Name, NodeId}; use syntax::attr::AttrMetaMethods; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index d9fc678554f..2f6d5e1c36e 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -55,8 +55,8 @@ use rustc::middle::cstore::CrateStore; use rustc::middle::def::*; use rustc::middle::def_id::DefId; use rustc::middle::pat_util::pat_bindings; -use rustc::middle::subst::{ParamSpace, FnSpace, TypeSpace}; -use rustc::middle::ty::{Freevar, FreevarMap, TraitMap, GlobMap}; +use rustc::ty::subst::{ParamSpace, FnSpace, TypeSpace}; +use rustc::ty::{Freevar, FreevarMap, TraitMap, GlobMap}; use rustc::util::nodemap::{NodeMap, FnvHashMap}; use syntax::ast::{self, FloatTy}; diff --git a/src/librustc_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml new file mode 100644 index 00000000000..a0cf70b57a9 --- /dev/null +++ b/src/librustc_save_analysis/Cargo.toml @@ -0,0 +1,15 @@ +[package] +authors = ["The Rust Project Developers"] +name = "rustc_save_analysis" +version = "0.0.0" + +[lib] +name = "rustc_save_analysis" +path = "lib.rs" +crate-type = ["dylib"] + +[dependencies] +log = { path = "../liblog" } +rustc = { path = "../librustc" } +rustc_front = { path = "../librustc_front" } +syntax = { path = "../libsyntax" } diff --git a/src/librustc_trans/save/csv_dumper.rs b/src/librustc_save_analysis/csv_dumper.rs similarity index 99% rename from src/librustc_trans/save/csv_dumper.rs rename to src/librustc_save_analysis/csv_dumper.rs index 2a5b7d9567b..3021d4e9820 100644 --- a/src/librustc_trans/save/csv_dumper.rs +++ b/src/librustc_save_analysis/csv_dumper.rs @@ -10,7 +10,7 @@ use std::io::Write; -use middle::def_id::{DefId, DefIndex}; +use rustc::middle::def_id::{DefId, DefIndex}; use syntax::codemap::Span; use super::data::*; diff --git a/src/librustc_trans/save/data.rs b/src/librustc_save_analysis/data.rs similarity index 99% rename from src/librustc_trans/save/data.rs rename to src/librustc_save_analysis/data.rs index 3eaaa3fc493..997a635f69e 100644 --- a/src/librustc_trans/save/data.rs +++ b/src/librustc_save_analysis/data.rs @@ -15,8 +15,8 @@ use std::hash::Hasher; -use middle::def_id::DefId; -use middle::ty; +use rustc::middle::def_id::DefId; +use rustc::ty; use syntax::ast::{CrateNum, NodeId}; use syntax::codemap::Span; diff --git a/src/librustc_trans/save/dump.rs b/src/librustc_save_analysis/dump.rs similarity index 100% rename from src/librustc_trans/save/dump.rs rename to src/librustc_save_analysis/dump.rs diff --git a/src/librustc_trans/save/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs similarity index 99% rename from src/librustc_trans/save/dump_visitor.rs rename to src/librustc_save_analysis/dump_visitor.rs index 65f48d1ff5e..88b72ccf329 100644 --- a/src/librustc_trans/save/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -27,11 +27,10 @@ //! is used for recording the output in a format-agnostic way (see CsvDumper //! for an example). -use session::Session; - -use middle::def::Def; -use middle::def_id::DefId; -use middle::ty::{self, TyCtxt}; +use rustc::middle::def::Def; +use rustc::middle::def_id::DefId; +use rustc::session::Session; +use rustc::ty::{self, TyCtxt}; use std::collections::HashSet; use std::hash::*; diff --git a/src/librustc_trans/save/mod.rs b/src/librustc_save_analysis/lib.rs similarity index 97% rename from src/librustc_trans/save/mod.rs rename to src/librustc_save_analysis/lib.rs index 4bbb7624693..f3a7076f955 100644 --- a/src/librustc_trans/save/mod.rs +++ b/src/librustc_save_analysis/lib.rs @@ -8,19 +8,37 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::ty::{self, TyCtxt}; -use middle::def::Def; -use middle::def_id::DefId; +#![crate_name = "rustc_save_analysis"] +#![unstable(feature = "rustc_private", issue = "27812")] +#![crate_type = "dylib"] +#![crate_type = "rlib"] +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/nightly/")] +#![cfg_attr(not(stage0), deny(warnings))] + +#![feature(custom_attribute)] +#![allow(unused_attributes)] +#![feature(rustc_private)] +#![feature(staged_api)] + +extern crate rustc; +extern crate rustc_front; + +#[macro_use] extern crate log; +#[macro_use] extern crate syntax; + +use rustc_front::{hir, lowering}; +use rustc::front::map::NodeItem; +use rustc::middle::def::Def; +use rustc::middle::def_id::DefId; +use rustc::session::config::CrateType::CrateTypeExecutable; +use rustc::ty::{self, TyCtxt}; use std::env; use std::fs::{self, File}; use std::path::{Path, PathBuf}; -use rustc_front; -use rustc_front::{hir, lowering}; -use rustc::front::map::NodeItem; -use rustc::session::config::CrateType::CrateTypeExecutable; - use syntax::ast::{self, NodeId, PatKind}; use syntax::ast_util; use syntax::codemap::*; diff --git a/src/librustc_trans/save/span_utils.rs b/src/librustc_save_analysis/span_utils.rs similarity index 99% rename from src/librustc_trans/save/span_utils.rs rename to src/librustc_save_analysis/span_utils.rs index 2a5c61f4e9d..4080607eed5 100644 --- a/src/librustc_trans/save/span_utils.rs +++ b/src/librustc_save_analysis/span_utils.rs @@ -10,7 +10,7 @@ use rustc::session::Session; -use save::generated_code; +use generated_code; use std::cell::Cell; use std::env; diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/_match.rs similarity index 99% rename from src/librustc_trans/trans/_match.rs rename to src/librustc_trans/_match.rs index 8aea2f1ec4f..008323ee5bf 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/_match.rs @@ -195,31 +195,31 @@ use middle::const_eval; use middle::def::{Def, DefMap}; use middle::def_id::DefId; use middle::expr_use_visitor as euv; -use middle::infer; +use rustc::infer; use middle::lang_items::StrEqFnLangItem; use middle::mem_categorization as mc; use middle::mem_categorization::Categorization; use middle::pat_util::*; -use middle::subst::Substs; -use trans::adt; -use trans::base::*; -use trans::build::{AddCase, And, Br, CondBr, GEPi, InBoundsGEP, Load, PointerCast}; -use trans::build::{Not, Store, Sub, add_comment}; -use trans::build; -use trans::callee::{Callee, ArgVals}; -use trans::cleanup::{self, CleanupMethods, DropHintMethods}; -use trans::common::*; -use trans::consts; -use trans::datum::*; -use trans::debuginfo::{self, DebugLoc, ToDebugLoc}; -use trans::expr::{self, Dest}; -use trans::monomorphize; -use trans::tvec; -use trans::type_of; -use trans::Disr; -use trans::value::Value; -use middle::ty::{self, Ty, TyCtxt}; -use middle::traits::ProjectionMode; +use rustc::ty::subst::Substs; +use adt; +use base::*; +use build::{AddCase, And, Br, CondBr, GEPi, InBoundsGEP, Load, PointerCast}; +use build::{Not, Store, Sub, add_comment}; +use build; +use callee::{Callee, ArgVals}; +use cleanup::{self, CleanupMethods, DropHintMethods}; +use common::*; +use consts; +use datum::*; +use debuginfo::{self, DebugLoc, ToDebugLoc}; +use expr::{self, Dest}; +use monomorphize; +use tvec; +use type_of; +use Disr; +use value::Value; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::traits::ProjectionMode; use session::config::NoDebugInfo; use util::common::indenter; use util::nodemap::FnvHashMap; @@ -281,7 +281,7 @@ impl<'a, 'tcx> Opt<'a, 'tcx> { } fn trans<'blk>(&self, mut bcx: Block<'blk, 'tcx>) -> OptResult<'blk, 'tcx> { - use trans::consts::TrueConst::Yes; + use consts::TrueConst::Yes; let _icx = push_ctxt("match::trans_opt"); let ccx = bcx.ccx(); match *self { diff --git a/src/librustc_trans/trans/abi.rs b/src/librustc_trans/abi.rs similarity index 97% rename from src/librustc_trans/trans/abi.rs rename to src/librustc_trans/abi.rs index fd086522b2e..dd72322997a 100644 --- a/src/librustc_trans/trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -9,25 +9,25 @@ // except according to those terms. use llvm::{self, ValueRef}; -use trans::base; -use trans::builder::Builder; -use trans::common::{type_is_fat_ptr, BlockAndBuilder}; -use trans::context::CrateContext; -use trans::cabi_x86; -use trans::cabi_x86_64; -use trans::cabi_x86_win64; -use trans::cabi_arm; -use trans::cabi_aarch64; -use trans::cabi_powerpc; -use trans::cabi_powerpc64; -use trans::cabi_mips; -use trans::cabi_asmjs; -use trans::machine::{llalign_of_min, llsize_of, llsize_of_real}; -use trans::type_::Type; -use trans::type_of; +use base; +use builder::Builder; +use common::{type_is_fat_ptr, BlockAndBuilder}; +use context::CrateContext; +use cabi_x86; +use cabi_x86_64; +use cabi_x86_win64; +use cabi_arm; +use cabi_aarch64; +use cabi_powerpc; +use cabi_powerpc64; +use cabi_mips; +use cabi_asmjs; +use machine::{llalign_of_min, llsize_of, llsize_of_real}; +use type_::Type; +use type_of; use rustc_front::hir; -use middle::ty::{self, Ty}; +use rustc::ty::{self, Ty}; use libc::c_uint; @@ -318,7 +318,7 @@ impl FnType { } ty::TyRef(b, mt) => { - use middle::ty::{BrAnon, ReLateBound}; + use rustc::ty::{BrAnon, ReLateBound}; // `&mut` pointer parameters never alias other parameters, or mutable global data // diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/adt.rs similarity index 99% rename from src/librustc_trans/trans/adt.rs rename to src/librustc_trans/adt.rs index db0fa2a64bd..7c190c2ff71 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/adt.rs @@ -48,26 +48,26 @@ use std; use std::rc::Rc; use llvm::{ValueRef, True, IntEQ, IntNE}; -use middle::subst; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::subst; +use rustc::ty::{self, Ty, TyCtxt}; use syntax::ast; use syntax::attr; use syntax::attr::IntType; -use trans::_match; -use trans::abi::FAT_PTR_ADDR; -use trans::base::InitAlloca; -use trans::build::*; -use trans::cleanup; -use trans::cleanup::CleanupMethods; -use trans::common::*; -use trans::datum; -use trans::debuginfo::DebugLoc; -use trans::glue; -use trans::machine; -use trans::monomorphize; -use trans::type_::Type; -use trans::type_of; -use trans::value::Value; +use _match; +use abi::FAT_PTR_ADDR; +use base::InitAlloca; +use build::*; +use cleanup; +use cleanup::CleanupMethods; +use common::*; +use datum; +use debuginfo::DebugLoc; +use glue; +use machine; +use monomorphize; +use type_::Type; +use type_of; +use value::Value; type Hint = attr::ReprAttr; diff --git a/src/librustc_trans/trans/asm.rs b/src/librustc_trans/asm.rs similarity index 96% rename from src/librustc_trans/trans/asm.rs rename to src/librustc_trans/asm.rs index 4d0c55131f7..41f1f4ae5f8 100644 --- a/src/librustc_trans/trans/asm.rs +++ b/src/librustc_trans/asm.rs @@ -11,12 +11,12 @@ //! # Translation of inline assembly. use llvm::{self, ValueRef}; -use trans::base; -use trans::build::*; -use trans::common::*; -use trans::datum::{Datum, Lvalue}; -use trans::type_of; -use trans::type_::Type; +use base; +use build::*; +use common::*; +use datum::{Datum, Lvalue}; +use type_of; +use type_::Type; use rustc_front::hir as ast; use std::ffi::CString; diff --git a/src/librustc_trans/trans/assert_dep_graph.rs b/src/librustc_trans/assert_dep_graph.rs similarity index 99% rename from src/librustc_trans/trans/assert_dep_graph.rs rename to src/librustc_trans/assert_dep_graph.rs index 11386715492..dcf23039e25 100644 --- a/src/librustc_trans/trans/assert_dep_graph.rs +++ b/src/librustc_trans/assert_dep_graph.rs @@ -40,7 +40,7 @@ use graphviz as dot; use rustc::dep_graph::{DepGraphQuery, DepNode}; use rustc::middle::def_id::DefId; -use rustc::middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc_data_structures::fnv::{FnvHashMap, FnvHashSet}; use rustc_data_structures::graph::{Direction, INCOMING, OUTGOING, NodeIndex}; use rustc_front::hir; diff --git a/src/librustc_trans/trans/attributes.rs b/src/librustc_trans/attributes.rs similarity index 99% rename from src/librustc_trans/trans/attributes.rs rename to src/librustc_trans/attributes.rs index b771afea0f3..d4930f37dcd 100644 --- a/src/librustc_trans/trans/attributes.rs +++ b/src/librustc_trans/attributes.rs @@ -14,7 +14,7 @@ use llvm::{self, ValueRef}; use session::config::NoDebugInfo; pub use syntax::attr::InlineAttr; use syntax::ast; -use trans::context::CrateContext; +use context::CrateContext; /// Mark LLVM function to use provided inline heuristic. #[inline] diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index 64d11710054..062f9482c72 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -23,7 +23,7 @@ use session::Session; use middle::cstore::{self, CrateStore, LinkMeta}; use middle::cstore::{LinkagePreference, NativeLibraryKind}; use middle::dependency_format::Linkage; -use trans::CrateTranslation; +use CrateTranslation; use util::common::time; use util::fs::fix_windows_verbatim_for_gcc; use rustc_back::tempdir::TempDir; diff --git a/src/librustc_trans/back/linker.rs b/src/librustc_trans/back/linker.rs index c6576b7fe0d..29caf93dcd5 100644 --- a/src/librustc_trans/back/linker.rs +++ b/src/librustc_trans/back/linker.rs @@ -22,7 +22,7 @@ use session::Session; use session::config::CrateTypeDylib; use session::config; use syntax::ast; -use trans::CrateTranslation; +use CrateTranslation; /// Linker abstraction used by back::link to build up the command to invoke a /// linker. diff --git a/src/librustc_trans/back/symbol_names.rs b/src/librustc_trans/back/symbol_names.rs index 5d578011da8..ee5282e9881 100644 --- a/src/librustc_trans/back/symbol_names.rs +++ b/src/librustc_trans/back/symbol_names.rs @@ -97,13 +97,14 @@ //! virtually impossible. Thus, symbol hash generation exclusively relies on //! DefPaths which are much more robust in the face of changes to the code base. -use trans::{CrateContext, Instance, gensym_name}; +use common::{CrateContext, gensym_name}; +use monomorphize::Instance; use util::sha2::{Digest, Sha256}; use rustc::middle::cstore; use rustc::middle::def_id::DefId; -use rustc::middle::ty::{self, TypeFoldable}; -use rustc::middle::ty::item_path::{ItemPathBuffer, RootMode}; +use rustc::ty::{self, TypeFoldable}; +use rustc::ty::item_path::{ItemPathBuffer, RootMode}; use rustc::front::map::definitions::{DefPath, DefPathData}; use std::fmt::Write; diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 92d8b928ef4..2de650a59be 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -16,7 +16,7 @@ use session::config::{self, OutputType}; use llvm; use llvm::{ModuleRef, TargetMachineRef, PassManagerRef, DiagnosticInfoRef, ContextRef}; use llvm::SMDiagnosticRef; -use trans::{CrateTranslation, ModuleTranslation}; +use {CrateTranslation, ModuleTranslation}; use util::common::time; use util::common::path2cstr; use syntax::codemap; diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/base.rs similarity index 98% rename from src/librustc_trans/trans/base.rs rename to src/librustc_trans/base.rs index 7231304ec4c..5f9997ffbb8 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/base.rs @@ -34,63 +34,63 @@ use back::{link, symbol_names}; use lint; use llvm::{BasicBlockRef, Linkage, ValueRef, Vector, get_param}; use llvm; -use middle::cfg; +use rustc::cfg; use middle::cstore::CrateStore; use middle::def_id::DefId; -use middle::infer; +use rustc::infer; use middle::lang_items::{LangItem, ExchangeMallocFnLangItem, StartFnLangItem}; use middle::weak_lang_items; use middle::pat_util::simple_name; -use middle::subst::{self, Substs}; -use middle::traits; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; -use middle::ty::adjustment::CustomCoerceUnsized; +use rustc::ty::subst::{self, Substs}; +use rustc::traits; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; +use rustc::ty::adjustment::CustomCoerceUnsized; use rustc::dep_graph::DepNode; use rustc::front::map as hir_map; use rustc::util::common::time; use rustc::mir::mir_map::MirMap; use session::config::{self, NoDebugInfo, FullDebugInfo}; use session::Session; -use trans::_match; -use trans::abi::{self, Abi, FnType}; -use trans::adt; -use trans::assert_dep_graph; -use trans::attributes; -use trans::build::*; -use trans::builder::{Builder, noname}; -use trans::callee::{Callee, CallArgs, ArgExprs, ArgVals}; -use trans::cleanup::{self, CleanupMethods, DropHint}; -use trans::closure; -use trans::common::{Block, C_bool, C_bytes_in_context, C_i32, C_int, C_uint, C_integral}; -use trans::collector::{self, TransItem, TransItemState, TransItemCollectionMode}; -use trans::common::{C_null, C_struct_in_context, C_u64, C_u8, C_undef}; -use trans::common::{CrateContext, DropFlagHintsMap, Field, FunctionContext}; -use trans::common::{Result, NodeIdAndSpan, VariantInfo}; -use trans::common::{node_id_type, fulfill_obligation}; -use trans::common::{type_is_immediate, type_is_zero_size, val_ty}; -use trans::common; -use trans::consts; -use trans::context::SharedCrateContext; -use trans::controlflow; -use trans::datum; -use trans::debuginfo::{self, DebugLoc, ToDebugLoc}; -use trans::declare; -use trans::expr; -use trans::glue; -use trans::inline; -use trans::intrinsic; -use trans::machine; -use trans::machine::{llalign_of_min, llsize_of, llsize_of_real}; -use trans::meth; -use trans::mir; -use trans::monomorphize::{self, Instance}; -use trans::symbol_names_test; -use trans::tvec; -use trans::type_::Type; -use trans::type_of; -use trans::type_of::*; -use trans::value::Value; -use trans::Disr; +use _match; +use abi::{self, Abi, FnType}; +use adt; +use assert_dep_graph; +use attributes; +use build::*; +use builder::{Builder, noname}; +use callee::{Callee, CallArgs, ArgExprs, ArgVals}; +use cleanup::{self, CleanupMethods, DropHint}; +use closure; +use common::{Block, C_bool, C_bytes_in_context, C_i32, C_int, C_uint, C_integral}; +use collector::{self, TransItem, TransItemState, TransItemCollectionMode}; +use common::{C_null, C_struct_in_context, C_u64, C_u8, C_undef}; +use common::{CrateContext, DropFlagHintsMap, Field, FunctionContext}; +use common::{Result, NodeIdAndSpan, VariantInfo}; +use common::{node_id_type, fulfill_obligation}; +use common::{type_is_immediate, type_is_zero_size, val_ty}; +use common; +use consts; +use context::SharedCrateContext; +use controlflow; +use datum; +use debuginfo::{self, DebugLoc, ToDebugLoc}; +use declare; +use expr; +use glue; +use inline; +use intrinsic; +use machine; +use machine::{llalign_of_min, llsize_of, llsize_of_real}; +use meth; +use mir; +use monomorphize::{self, Instance}; +use symbol_names_test; +use tvec; +use type_::Type; +use type_of; +use type_of::*; +use value::Value; +use Disr; use util::common::indenter; use util::sha2::Sha256; use util::nodemap::{NodeMap, NodeSet}; diff --git a/src/librustc_trans/trans/basic_block.rs b/src/librustc_trans/basic_block.rs similarity index 97% rename from src/librustc_trans/trans/basic_block.rs rename to src/librustc_trans/basic_block.rs index d3d055cda12..919ea49b392 100644 --- a/src/librustc_trans/trans/basic_block.rs +++ b/src/librustc_trans/basic_block.rs @@ -10,7 +10,7 @@ use llvm; use llvm::BasicBlockRef; -use trans::value::{Users, Value}; +use value::{Users, Value}; use std::iter::{Filter, Map}; #[derive(Copy, Clone)] diff --git a/src/librustc_trans/trans/build.rs b/src/librustc_trans/build.rs similarity index 99% rename from src/librustc_trans/trans/build.rs rename to src/librustc_trans/build.rs index 53e64c086a8..0ce7fdb8b6d 100644 --- a/src/librustc_trans/trans/build.rs +++ b/src/librustc_trans/build.rs @@ -15,13 +15,13 @@ use llvm; use llvm::{AtomicBinOp, AtomicOrdering, SynchronizationScope, AsmDialect}; use llvm::{Opcode, IntPredicate, RealPredicate}; use llvm::{ValueRef, BasicBlockRef}; -use trans::common::*; +use common::*; use syntax::codemap::Span; -use trans::builder::Builder; -use trans::type_::Type; -use trans::value::Value; -use trans::debuginfo::DebugLoc; +use builder::Builder; +use type_::Type; +use value::Value; +use debuginfo::DebugLoc; use libc::{c_uint, c_char}; diff --git a/src/librustc_trans/trans/builder.rs b/src/librustc_trans/builder.rs similarity index 99% rename from src/librustc_trans/trans/builder.rs rename to src/librustc_trans/builder.rs index 869e9212b1c..55f65d29bfd 100644 --- a/src/librustc_trans/trans/builder.rs +++ b/src/librustc_trans/builder.rs @@ -14,11 +14,11 @@ use llvm; use llvm::{AtomicBinOp, AtomicOrdering, SynchronizationScope, AsmDialect}; use llvm::{Opcode, IntPredicate, RealPredicate, False, OperandBundleDef}; use llvm::{ValueRef, BasicBlockRef, BuilderRef, ModuleRef}; -use trans::base; -use trans::common::*; -use trans::machine::llalign_of_pref; -use trans::type_::Type; -use trans::value::Value; +use base; +use common::*; +use machine::llalign_of_pref; +use type_::Type; +use value::Value; use util::nodemap::FnvHashMap; use libc::{c_uint, c_char}; diff --git a/src/librustc_trans/trans/cabi_aarch64.rs b/src/librustc_trans/cabi_aarch64.rs similarity index 98% rename from src/librustc_trans/trans/cabi_aarch64.rs rename to src/librustc_trans/cabi_aarch64.rs index 6eea8d472ba..b2929d118a6 100644 --- a/src/librustc_trans/trans/cabi_aarch64.rs +++ b/src/librustc_trans/cabi_aarch64.rs @@ -11,9 +11,9 @@ #![allow(non_upper_case_globals)] use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector}; -use trans::abi::{FnType, ArgType}; -use trans::context::CrateContext; -use trans::type_::Type; +use abi::{FnType, ArgType}; +use context::CrateContext; +use type_::Type; use std::cmp; diff --git a/src/librustc_trans/trans/cabi_arm.rs b/src/librustc_trans/cabi_arm.rs similarity index 98% rename from src/librustc_trans/trans/cabi_arm.rs rename to src/librustc_trans/cabi_arm.rs index 14ca77836c2..5dbcf1ef86e 100644 --- a/src/librustc_trans/trans/cabi_arm.rs +++ b/src/librustc_trans/cabi_arm.rs @@ -11,9 +11,9 @@ #![allow(non_upper_case_globals)] use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector}; -use trans::abi::{FnType, ArgType}; -use trans::context::CrateContext; -use trans::type_::Type; +use abi::{FnType, ArgType}; +use context::CrateContext; +use type_::Type; use std::cmp; diff --git a/src/librustc_trans/trans/cabi_asmjs.rs b/src/librustc_trans/cabi_asmjs.rs similarity index 95% rename from src/librustc_trans/trans/cabi_asmjs.rs rename to src/librustc_trans/cabi_asmjs.rs index c901442f485..3cbc378ab02 100644 --- a/src/librustc_trans/trans/cabi_asmjs.rs +++ b/src/librustc_trans/cabi_asmjs.rs @@ -11,8 +11,8 @@ #![allow(non_upper_case_globals)] use llvm::{Struct, Array, Attribute}; -use trans::abi::{FnType, ArgType}; -use trans::context::CrateContext; +use abi::{FnType, ArgType}; +use context::CrateContext; // Data layout: e-p:32:32-i64:64-v128:32:128-n32-S128 diff --git a/src/librustc_trans/trans/cabi_mips.rs b/src/librustc_trans/cabi_mips.rs similarity index 97% rename from src/librustc_trans/trans/cabi_mips.rs rename to src/librustc_trans/cabi_mips.rs index 0d5e81be921..d0fce01ce73 100644 --- a/src/librustc_trans/trans/cabi_mips.rs +++ b/src/librustc_trans/cabi_mips.rs @@ -14,9 +14,9 @@ use libc::c_uint; use std::cmp; use llvm; use llvm::{Integer, Pointer, Float, Double, Struct, Array, Vector}; -use trans::abi::{ArgType, FnType}; -use trans::context::CrateContext; -use trans::type_::Type; +use abi::{ArgType, FnType}; +use context::CrateContext; +use type_::Type; fn align_up_to(off: usize, a: usize) -> usize { return (off + a - 1) / a * a; diff --git a/src/librustc_trans/trans/cabi_powerpc.rs b/src/librustc_trans/cabi_powerpc.rs similarity index 97% rename from src/librustc_trans/trans/cabi_powerpc.rs rename to src/librustc_trans/cabi_powerpc.rs index 9aa89a04d0a..c9751aa25c1 100644 --- a/src/librustc_trans/trans/cabi_powerpc.rs +++ b/src/librustc_trans/cabi_powerpc.rs @@ -11,9 +11,9 @@ use libc::c_uint; use llvm; use llvm::{Integer, Pointer, Float, Double, Struct, Array}; -use trans::abi::{FnType, ArgType}; -use trans::context::CrateContext; -use trans::type_::Type; +use abi::{FnType, ArgType}; +use context::CrateContext; +use type_::Type; use std::cmp; diff --git a/src/librustc_trans/trans/cabi_powerpc64.rs b/src/librustc_trans/cabi_powerpc64.rs similarity index 98% rename from src/librustc_trans/trans/cabi_powerpc64.rs rename to src/librustc_trans/cabi_powerpc64.rs index 340de235732..7e7033b4686 100644 --- a/src/librustc_trans/trans/cabi_powerpc64.rs +++ b/src/librustc_trans/cabi_powerpc64.rs @@ -16,9 +16,9 @@ // need to be fixed when PowerPC vector support is added. use llvm::{Integer, Pointer, Float, Double, Struct, Array}; -use trans::abi::{FnType, ArgType}; -use trans::context::CrateContext; -use trans::type_::Type; +use abi::{FnType, ArgType}; +use context::CrateContext; +use type_::Type; use std::cmp; diff --git a/src/librustc_trans/trans/cabi_x86.rs b/src/librustc_trans/cabi_x86.rs similarity index 97% rename from src/librustc_trans/trans/cabi_x86.rs rename to src/librustc_trans/cabi_x86.rs index 9e6c4d9af42..415579eb221 100644 --- a/src/librustc_trans/trans/cabi_x86.rs +++ b/src/librustc_trans/cabi_x86.rs @@ -9,8 +9,8 @@ // except according to those terms. use llvm::*; -use trans::abi::FnType; -use trans::type_::Type; +use abi::FnType; +use type_::Type; use super::common::*; use super::machine::*; diff --git a/src/librustc_trans/trans/cabi_x86_64.rs b/src/librustc_trans/cabi_x86_64.rs similarity index 99% rename from src/librustc_trans/trans/cabi_x86_64.rs rename to src/librustc_trans/cabi_x86_64.rs index 47d373f9043..a08d9fb5b40 100644 --- a/src/librustc_trans/trans/cabi_x86_64.rs +++ b/src/librustc_trans/cabi_x86_64.rs @@ -16,9 +16,9 @@ use self::RegClass::*; use llvm::{Integer, Pointer, Float, Double}; use llvm::{Struct, Array, Attribute, Vector}; -use trans::abi::{ArgType, FnType}; -use trans::context::CrateContext; -use trans::type_::Type; +use abi::{ArgType, FnType}; +use context::CrateContext; +use type_::Type; use std::cmp; diff --git a/src/librustc_trans/trans/cabi_x86_win64.rs b/src/librustc_trans/cabi_x86_win64.rs similarity index 95% rename from src/librustc_trans/trans/cabi_x86_win64.rs rename to src/librustc_trans/cabi_x86_win64.rs index 43f72c454cf..a5077f68fb5 100644 --- a/src/librustc_trans/trans/cabi_x86_win64.rs +++ b/src/librustc_trans/cabi_x86_win64.rs @@ -11,8 +11,8 @@ use llvm::*; use super::common::*; use super::machine::*; -use trans::abi::{ArgType, FnType}; -use trans::type_::Type; +use abi::{ArgType, FnType}; +use type_::Type; // Win64 ABI: http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/callee.rs similarity index 97% rename from src/librustc_trans/trans/callee.rs rename to src/librustc_trans/callee.rs index 6fe4598c1ba..d3c2a895379 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/callee.rs @@ -22,38 +22,38 @@ use back::symbol_names; use llvm::{self, ValueRef, get_params}; use middle::cstore::LOCAL_CRATE; use middle::def_id::DefId; -use middle::infer; -use middle::subst; -use middle::subst::{Substs}; -use middle::traits; +use rustc::infer; +use rustc::ty::subst; +use rustc::ty::subst::{Substs}; +use rustc::traits; use rustc::front::map as hir_map; -use trans::abi::{Abi, FnType}; -use trans::adt; -use trans::attributes; -use trans::base; -use trans::base::*; -use trans::build::*; -use trans::cleanup; -use trans::cleanup::CleanupMethods; -use trans::closure; -use trans::common::{self, Block, Result, CrateContext, FunctionContext}; -use trans::common::{C_uint, C_undef}; -use trans::consts; -use trans::datum::*; -use trans::debuginfo::DebugLoc; -use trans::declare; -use trans::expr; -use trans::glue; -use trans::inline; -use trans::intrinsic; -use trans::machine::{llalign_of_min, llsize_of_store}; -use trans::meth; -use trans::monomorphize::{self, Instance}; -use trans::type_::Type; -use trans::type_of; -use trans::value::Value; -use trans::Disr; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +use abi::{Abi, FnType}; +use adt; +use attributes; +use base; +use base::*; +use build::*; +use cleanup; +use cleanup::CleanupMethods; +use closure; +use common::{self, Block, Result, CrateContext, FunctionContext}; +use common::{C_uint, C_undef}; +use consts; +use datum::*; +use debuginfo::DebugLoc; +use declare; +use expr; +use glue; +use inline; +use intrinsic; +use machine::{llalign_of_min, llsize_of_store}; +use meth; +use monomorphize::{self, Instance}; +use type_::Type; +use type_of; +use value::Value; +use Disr; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc_front::hir; use syntax::codemap::DUMMY_SP; diff --git a/src/librustc_trans/trans/cleanup.rs b/src/librustc_trans/cleanup.rs similarity index 99% rename from src/librustc_trans/trans/cleanup.rs rename to src/librustc_trans/cleanup.rs index bd2d05915f6..3a8dc144f9c 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/cleanup.rs @@ -120,17 +120,17 @@ pub use self::EarlyExitLabel::*; pub use self::Heap::*; use llvm::{BasicBlockRef, ValueRef}; -use trans::base; -use trans::build; -use trans::common; -use trans::common::{Block, FunctionContext, NodeIdAndSpan, LandingPad}; -use trans::datum::{Datum, Lvalue}; -use trans::debuginfo::{DebugLoc, ToDebugLoc}; -use trans::glue; +use base; +use build; +use common; +use common::{Block, FunctionContext, NodeIdAndSpan, LandingPad}; +use datum::{Datum, Lvalue}; +use debuginfo::{DebugLoc, ToDebugLoc}; +use glue; use middle::region; -use trans::type_::Type; -use trans::value::Value; -use middle::ty::{Ty, TyCtxt}; +use type_::Type; +use value::Value; +use rustc::ty::{Ty, TyCtxt}; use std::fmt; use syntax::ast; diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/closure.rs similarity index 96% rename from src/librustc_trans/trans/closure.rs rename to src/librustc_trans/closure.rs index ff3235385a9..44b4f256082 100644 --- a/src/librustc_trans/trans/closure.rs +++ b/src/librustc_trans/closure.rs @@ -12,25 +12,25 @@ use arena::TypedArena; use back::symbol_names; use llvm::{ValueRef, get_param, get_params}; use middle::def_id::DefId; -use middle::infer; -use middle::traits::ProjectionMode; -use trans::abi::{Abi, FnType}; -use trans::adt; -use trans::attributes; -use trans::base::*; -use trans::build::*; -use trans::callee::{self, ArgVals, Callee}; -use trans::cleanup::{CleanupMethods, CustomScope, ScopeId}; -use trans::common::*; -use trans::datum::{ByRef, Datum, lvalue_scratch_datum}; -use trans::datum::{rvalue_scratch_datum, Rvalue}; -use trans::debuginfo::{self, DebugLoc}; -use trans::declare; -use trans::expr; -use trans::monomorphize::{Instance}; -use trans::value::Value; -use trans::Disr; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::infer; +use rustc::traits::ProjectionMode; +use abi::{Abi, FnType}; +use adt; +use attributes; +use base::*; +use build::*; +use callee::{self, ArgVals, Callee}; +use cleanup::{CleanupMethods, CustomScope, ScopeId}; +use common::*; +use datum::{ByRef, Datum, lvalue_scratch_datum}; +use datum::{rvalue_scratch_datum, Rvalue}; +use debuginfo::{self, DebugLoc}; +use declare; +use expr; +use monomorphize::{Instance}; +use value::Value; +use Disr; +use rustc::ty::{self, Ty, TyCtxt}; use session::config::FullDebugInfo; use syntax::ast; diff --git a/src/librustc_trans/trans/collector.rs b/src/librustc_trans/collector.rs similarity index 99% rename from src/librustc_trans/trans/collector.rs rename to src/librustc_trans/collector.rs index 3f3da36be06..7c5f784216a 100644 --- a/src/librustc_trans/trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -194,10 +194,10 @@ use rustc_front::intravisit as hir_visit; use rustc::front::map as hir_map; use rustc::middle::def_id::DefId; use rustc::middle::lang_items::{ExchangeFreeFnLangItem, ExchangeMallocFnLangItem}; -use rustc::middle::traits; -use rustc::middle::subst::{self, Substs, Subst}; -use rustc::middle::ty::{self, Ty, TypeFoldable}; -use rustc::middle::ty::adjustment::CustomCoerceUnsized; +use rustc::traits; +use rustc::ty::subst::{self, Substs, Subst}; +use rustc::ty::{self, Ty, TypeFoldable}; +use rustc::ty::adjustment::CustomCoerceUnsized; use rustc::mir::repr as mir; use rustc::mir::visit as mir_visit; use rustc::mir::visit::Visitor as MirVisitor; @@ -207,13 +207,13 @@ use syntax::codemap::DUMMY_SP; use syntax::errors; use syntax::parse::token; -use trans::base::custom_coerce_unsize_info; -use trans::context::CrateContext; -use trans::common::{fulfill_obligation, normalize_and_test_predicates, +use base::custom_coerce_unsize_info; +use context::CrateContext; +use common::{fulfill_obligation, normalize_and_test_predicates, type_is_sized}; -use trans::glue; -use trans::meth; -use trans::monomorphize::{self, Instance}; +use glue; +use meth; +use monomorphize::{self, Instance}; use util::nodemap::{FnvHashSet, FnvHashMap, DefIdMap}; use std::hash::{Hash, Hasher}; @@ -580,7 +580,7 @@ fn find_drop_glue_neighbors<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, }; if let Some(destructor_did) = destructor_did { - use rustc::middle::ty::ToPolyTraitRef; + use rustc::ty::ToPolyTraitRef; let drop_trait_def_id = ccx.tcx() .lang_items @@ -1202,7 +1202,7 @@ pub fn push_unique_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, output.push_str("unsafe "); } - if abi != ::trans::abi::Abi::Rust { + if abi != ::abi::Abi::Rust { output.push_str("extern \""); output.push_str(abi.name()); output.push_str("\" "); diff --git a/src/librustc_trans/trans/common.rs b/src/librustc_trans/common.rs similarity index 98% rename from src/librustc_trans/trans/common.rs rename to src/librustc_trans/common.rs index db06b2352fd..c5d54e30f13 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/common.rs @@ -16,30 +16,30 @@ use session::Session; use llvm; use llvm::{ValueRef, BasicBlockRef, BuilderRef, ContextRef, TypeKind}; use llvm::{True, False, Bool, OperandBundleDef}; -use middle::cfg; +use rustc::cfg; use middle::def::Def; use middle::def_id::DefId; -use middle::infer; +use rustc::infer; use middle::lang_items::LangItem; -use middle::subst::Substs; -use trans::abi::{Abi, FnType}; -use trans::base; -use trans::build; -use trans::builder::Builder; -use trans::callee::Callee; -use trans::cleanup; -use trans::consts; -use trans::datum; -use trans::debuginfo::{self, DebugLoc}; -use trans::declare; -use trans::machine; -use trans::mir::CachedMir; -use trans::monomorphize; -use trans::type_::Type; -use trans::value::Value; -use middle::ty::{self, Ty, TyCtxt}; -use middle::traits::{self, SelectionContext, ProjectionMode}; -use middle::ty::fold::{TypeFolder, TypeFoldable}; +use rustc::ty::subst::Substs; +use abi::{Abi, FnType}; +use base; +use build; +use builder::Builder; +use callee::Callee; +use cleanup; +use consts; +use datum; +use debuginfo::{self, DebugLoc}; +use declare; +use machine; +use mir::CachedMir; +use monomorphize; +use type_::Type; +use value::Value; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::traits::{self, SelectionContext, ProjectionMode}; +use rustc::ty::fold::{TypeFolder, TypeFoldable}; use rustc_front::hir; use util::nodemap::NodeMap; @@ -54,7 +54,7 @@ use syntax::codemap::{DUMMY_SP, Span}; use syntax::parse::token::InternedString; use syntax::parse::token; -pub use trans::context::CrateContext; +pub use context::CrateContext; /// Is the type's representation size known at compile time? pub fn type_is_sized<'tcx>(tcx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool { @@ -75,8 +75,8 @@ pub fn type_is_fat_ptr<'tcx>(cx: &TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool { } pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool { - use trans::machine::llsize_of_alloc; - use trans::type_of::sizing_type_of; + use machine::llsize_of_alloc; + use type_of::sizing_type_of; let tcx = ccx.tcx(); let simple = ty.is_scalar() || @@ -100,8 +100,8 @@ pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) - /// Identify types which have size zero at runtime. pub fn type_is_zero_size<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool { - use trans::machine::llsize_of_alloc; - use trans::type_of::sizing_type_of; + use machine::llsize_of_alloc; + use type_of::sizing_type_of; let llty = sizing_type_of(ccx, ty); llsize_of_alloc(ccx, llty) == 0 } @@ -141,7 +141,7 @@ pub fn gensym_name(name: &str) -> ast::Name { * */ -use trans::Disr; +use Disr; #[derive(Copy, Clone)] pub struct NodeIdAndSpan { @@ -491,7 +491,7 @@ impl<'a, 'tcx> FunctionContext<'a, 'tcx> { // Returns a ValueRef of the "eh_unwind_resume" lang item if one is defined, // otherwise declares it as an external function. pub fn eh_unwind_resume(&self) -> Callee<'tcx> { - use trans::attributes; + use attributes; let ccx = self.ccx; let tcx = ccx.tcx(); assert!(ccx.sess().target.target.options.custom_unwind_resume); diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/consts.rs similarity index 98% rename from src/librustc_trans/trans/consts.rs rename to src/librustc_trans/consts.rs index 4cdb64a9bfb..8302fc0158c 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/consts.rs @@ -17,26 +17,26 @@ use middle::const_eval::{self, ConstEvalErr}; use middle::def::Def; use middle::def_id::DefId; use rustc::front::map as hir_map; -use trans::{abi, adt, closure, debuginfo, expr, machine}; -use trans::base::{self, exported_name, imported_name, push_ctxt}; -use trans::callee::Callee; -use trans::collector::{self, TransItem}; -use trans::common::{type_is_sized, C_nil, const_get_elt}; -use trans::common::{CrateContext, C_integral, C_floating, C_bool, C_str_slice, C_bytes, val_ty}; -use trans::common::{C_struct, C_undef, const_to_opt_int, const_to_opt_uint, VariantInfo, C_uint}; -use trans::common::{type_is_fat_ptr, Field, C_vector, C_array, C_null}; -use trans::datum::{Datum, Lvalue}; -use trans::declare; -use trans::monomorphize::{self, Instance}; -use trans::type_::Type; -use trans::type_of; -use trans::value::Value; -use trans::Disr; -use middle::subst::Substs; -use middle::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer}; -use middle::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::cast::{CastTy,IntTy}; +use {abi, adt, closure, debuginfo, expr, machine}; +use base::{self, exported_name, imported_name, push_ctxt}; +use callee::Callee; +use collector::{self, TransItem}; +use common::{type_is_sized, C_nil, const_get_elt}; +use common::{CrateContext, C_integral, C_floating, C_bool, C_str_slice, C_bytes, val_ty}; +use common::{C_struct, C_undef, const_to_opt_int, const_to_opt_uint, VariantInfo, C_uint}; +use common::{type_is_fat_ptr, Field, C_vector, C_array, C_null}; +use datum::{Datum, Lvalue}; +use declare; +use monomorphize::{self, Instance}; +use type_::Type; +use type_of; +use value::Value; +use Disr; +use rustc::ty::subst::Substs; +use rustc::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer}; +use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::cast::{CastTy,IntTy}; use util::nodemap::NodeMap; use rustc_const_eval::{ConstInt, ConstMathErr, ConstUsize, ConstIsize}; diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/context.rs similarity index 99% rename from src/librustc_trans/trans/context.rs rename to src/librustc_trans/context.rs index bd556c0f2eb..dcf96cfa814 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/context.rs @@ -14,23 +14,23 @@ use rustc::dep_graph::{DepNode, DepTrackingMap, DepTrackingMapConfig}; use middle::cstore::LinkMeta; use middle::def::ExportMap; use middle::def_id::DefId; -use middle::traits; +use rustc::traits; use rustc::mir::mir_map::MirMap; use rustc::mir::repr as mir; -use trans::adt; -use trans::base; -use trans::builder::Builder; -use trans::common::BuilderRef_res; -use trans::debuginfo; -use trans::declare; -use trans::glue::DropGlueKind; -use trans::mir::CachedMir; -use trans::Instance; +use adt; +use base; +use builder::Builder; +use common::BuilderRef_res; +use debuginfo; +use declare; +use glue::DropGlueKind; +use mir::CachedMir; +use monomorphize::Instance; -use trans::collector::{TransItem, TransItemState}; -use trans::type_::{Type, TypeNames}; -use middle::subst::{Substs, VecPerParamSpace}; -use middle::ty::{self, Ty, TyCtxt}; +use collector::{TransItem, TransItemState}; +use type_::{Type, TypeNames}; +use rustc::ty::subst::{Substs, VecPerParamSpace}; +use rustc::ty::{self, Ty, TyCtxt}; use session::config::NoDebugInfo; use session::Session; use util::sha2::Sha256; diff --git a/src/librustc_trans/trans/controlflow.rs b/src/librustc_trans/controlflow.rs similarity index 95% rename from src/librustc_trans/trans/controlflow.rs rename to src/librustc_trans/controlflow.rs index 91454df1566..04562087af7 100644 --- a/src/librustc_trans/trans/controlflow.rs +++ b/src/librustc_trans/controlflow.rs @@ -11,20 +11,19 @@ use llvm::ValueRef; use middle::def::Def; use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem}; -use middle::subst::Substs; -use trans::base::*; -use trans::basic_block::BasicBlock; -use trans::build::*; -use trans::callee::{Callee, ArgVals}; -use trans::cleanup::CleanupMethods; -use trans::cleanup; -use trans::common::*; -use trans::consts; -use trans::debuginfo; -use trans::debuginfo::{DebugLoc, ToDebugLoc}; -use trans::expr; -use trans::machine; -use trans; +use rustc::ty::subst::Substs; +use base::*; +use basic_block::BasicBlock; +use build::*; +use callee::{Callee, ArgVals}; +use cleanup::CleanupMethods; +use cleanup; +use common::*; +use consts; +use debuginfo; +use debuginfo::{DebugLoc, ToDebugLoc}; +use expr; +use machine; use rustc_front::hir; use rustc_front::util as ast_util; @@ -169,11 +168,11 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, if cv == 1 { // if true { .. } [else { .. }] bcx = trans_block(bcx, &thn, dest); - trans::debuginfo::clear_source_location(bcx.fcx); + debuginfo::clear_source_location(bcx.fcx); } else { if let Some(elexpr) = els { bcx = expr::trans_into(bcx, &elexpr, dest); - trans::debuginfo::clear_source_location(bcx.fcx); + debuginfo::clear_source_location(bcx.fcx); } } @@ -183,7 +182,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, let name = format!("then-block-{}-", thn.id); let then_bcx_in = bcx.fcx.new_id_block(&name[..], thn.id); let then_bcx_out = trans_block(then_bcx_in, &thn, dest); - trans::debuginfo::clear_source_location(bcx.fcx); + debuginfo::clear_source_location(bcx.fcx); let cond_source_loc = cond.debug_loc(); @@ -206,7 +205,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, // Clear the source location because it is still set to whatever has been translated // right before. - trans::debuginfo::clear_source_location(next_bcx.fcx); + debuginfo::clear_source_location(next_bcx.fcx); next_bcx } diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/datum.rs similarity index 99% rename from src/librustc_trans/trans/datum.rs rename to src/librustc_trans/datum.rs index 649f6180de2..6f96b5769bf 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/datum.rs @@ -93,16 +93,16 @@ pub use self::Expr::*; pub use self::RvalueMode::*; use llvm::ValueRef; -use trans::adt; -use trans::base::*; -use trans::build::{Load, Store}; -use trans::common::*; -use trans::cleanup; -use trans::cleanup::{CleanupMethods, DropHintDatum, DropHintMethods}; -use trans::expr; -use trans::tvec; -use trans::value::Value; -use middle::ty::Ty; +use adt; +use base::*; +use build::{Load, Store}; +use common::*; +use cleanup; +use cleanup::{CleanupMethods, DropHintDatum, DropHintMethods}; +use expr; +use tvec; +use value::Value; +use rustc::ty::Ty; use std::fmt; use syntax::ast; diff --git a/src/librustc_trans/trans/debuginfo/create_scope_map.rs b/src/librustc_trans/debuginfo/create_scope_map.rs similarity index 99% rename from src/librustc_trans/trans/debuginfo/create_scope_map.rs rename to src/librustc_trans/debuginfo/create_scope_map.rs index 41fed12e7bf..20e8a3fb0cf 100644 --- a/src/librustc_trans/trans/debuginfo/create_scope_map.rs +++ b/src/librustc_trans/debuginfo/create_scope_map.rs @@ -13,7 +13,7 @@ use super::utils::DIB; use llvm; use llvm::debuginfo::{DIScope, DISubprogram}; -use trans::common::CrateContext; +use common::CrateContext; use middle::pat_util; use rustc::util::nodemap::NodeMap; diff --git a/src/librustc_trans/trans/debuginfo/doc.rs b/src/librustc_trans/debuginfo/doc.rs similarity index 100% rename from src/librustc_trans/trans/debuginfo/doc.rs rename to src/librustc_trans/debuginfo/doc.rs diff --git a/src/librustc_trans/trans/debuginfo/gdb.rs b/src/librustc_trans/debuginfo/gdb.rs similarity index 97% rename from src/librustc_trans/trans/debuginfo/gdb.rs rename to src/librustc_trans/debuginfo/gdb.rs index 7740f277586..5612f3d1e90 100644 --- a/src/librustc_trans/trans/debuginfo/gdb.rs +++ b/src/librustc_trans/debuginfo/gdb.rs @@ -12,9 +12,9 @@ use llvm; -use trans::common::{C_bytes, CrateContext, C_i32}; -use trans::declare; -use trans::type_::Type; +use common::{C_bytes, CrateContext, C_i32}; +use declare; +use type_::Type; use session::config::NoDebugInfo; use std::ffi::CString; diff --git a/src/librustc_trans/trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs similarity index 99% rename from src/librustc_trans/trans/debuginfo/metadata.rs rename to src/librustc_trans/debuginfo/metadata.rs index e22d42e9d28..af7ccdb6cf5 100644 --- a/src/librustc_trans/trans/debuginfo/metadata.rs +++ b/src/librustc_trans/debuginfo/metadata.rs @@ -24,16 +24,16 @@ use llvm::{self, ValueRef}; use llvm::debuginfo::{DIType, DIFile, DIScope, DIDescriptor, DICompositeType}; use middle::def_id::DefId; -use middle::infer; +use rustc::infer; use middle::pat_util; -use middle::subst; +use rustc::ty::subst; use rustc::front::map as hir_map; use rustc_front::hir::{self, PatKind}; -use trans::{type_of, adt, machine, monomorphize}; -use trans::common::{self, CrateContext, FunctionContext, Block}; -use trans::_match::{BindingInfo, TransBindingMode}; -use trans::type_::Type; -use middle::ty::{self, Ty}; +use {type_of, adt, machine, monomorphize}; +use common::{self, CrateContext, FunctionContext, Block}; +use _match::{BindingInfo, TransBindingMode}; +use type_::Type; +use rustc::ty::{self, Ty}; use session::config::{self, FullDebugInfo}; use util::nodemap::FnvHashMap; use util::common::path2cstr; diff --git a/src/librustc_trans/trans/debuginfo/mod.rs b/src/librustc_trans/debuginfo/mod.rs similarity index 98% rename from src/librustc_trans/trans/debuginfo/mod.rs rename to src/librustc_trans/debuginfo/mod.rs index 40eb29ed250..66e33698389 100644 --- a/src/librustc_trans/trans/debuginfo/mod.rs +++ b/src/librustc_trans/debuginfo/mod.rs @@ -27,17 +27,16 @@ use llvm::{ModuleRef, ContextRef, ValueRef}; use llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilderRef, DISubprogram, DIArray, DIDescriptor, FlagPrototyped}; use middle::def_id::DefId; -use middle::infer::normalize_associated_type; -use middle::subst::{self, Substs}; +use rustc::infer::normalize_associated_type; +use rustc::ty::subst::{self, Substs}; use rustc_front; use rustc_front::hir; -use trans::abi::Abi; -use trans::common::{NodeIdAndSpan, CrateContext, FunctionContext, Block}; -use trans; -use trans::monomorphize; -use middle::infer; -use middle::ty::{self, Ty}; +use abi::Abi; +use common::{NodeIdAndSpan, CrateContext, FunctionContext, Block}; +use monomorphize; +use rustc::infer; +use rustc::ty::{self, Ty}; use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo}; use util::nodemap::{NodeMap, FnvHashMap, FnvHashSet}; use rustc::front::map as hir_map; @@ -632,7 +631,7 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, debug_loc, bcx.llbb); - llvm::LLVMSetInstDebugLocation(trans::build::B(bcx).llbuilder, instr); + llvm::LLVMSetInstDebugLocation(::build::B(bcx).llbuilder, instr); } } } diff --git a/src/librustc_trans/trans/debuginfo/namespace.rs b/src/librustc_trans/debuginfo/namespace.rs similarity index 99% rename from src/librustc_trans/trans/debuginfo/namespace.rs rename to src/librustc_trans/debuginfo/namespace.rs index 0c2c29724a1..552188ae2a6 100644 --- a/src/librustc_trans/trans/debuginfo/namespace.rs +++ b/src/librustc_trans/debuginfo/namespace.rs @@ -16,7 +16,7 @@ use llvm; use llvm::debuginfo::DIScope; use rustc::middle::def_id::DefId; use rustc::front::map as hir_map; -use trans::common::CrateContext; +use common::CrateContext; use std::ffi::CString; use std::ptr; diff --git a/src/librustc_trans/trans/debuginfo/source_loc.rs b/src/librustc_trans/debuginfo/source_loc.rs similarity index 99% rename from src/librustc_trans/trans/debuginfo/source_loc.rs rename to src/librustc_trans/debuginfo/source_loc.rs index 981a23fd664..2879da7d03b 100644 --- a/src/librustc_trans/trans/debuginfo/source_loc.rs +++ b/src/librustc_trans/debuginfo/source_loc.rs @@ -16,7 +16,7 @@ use super::{FunctionDebugContext, DebugLoc}; use llvm; use llvm::debuginfo::DIScope; -use trans::common::{NodeIdAndSpan, CrateContext, FunctionContext}; +use common::{NodeIdAndSpan, CrateContext, FunctionContext}; use libc::c_uint; use std::ptr; diff --git a/src/librustc_trans/trans/debuginfo/type_names.rs b/src/librustc_trans/debuginfo/type_names.rs similarity index 98% rename from src/librustc_trans/trans/debuginfo/type_names.rs rename to src/librustc_trans/debuginfo/type_names.rs index b71b7789aff..71dd3e432df 100644 --- a/src/librustc_trans/trans/debuginfo/type_names.rs +++ b/src/librustc_trans/debuginfo/type_names.rs @@ -12,11 +12,11 @@ use super::namespace::crate_root_namespace; -use trans::common::CrateContext; +use common::CrateContext; use middle::def_id::DefId; -use middle::infer; -use middle::subst; -use middle::ty::{self, Ty}; +use rustc::infer; +use rustc::ty::subst; +use rustc::ty::{self, Ty}; use rustc_front::hir; @@ -107,7 +107,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, output.push_str("unsafe "); } - if abi != ::trans::abi::Abi::Rust { + if abi != ::abi::Abi::Rust { output.push_str("extern \""); output.push_str(abi.name()); output.push_str("\" "); diff --git a/src/librustc_trans/trans/debuginfo/utils.rs b/src/librustc_trans/debuginfo/utils.rs similarity index 97% rename from src/librustc_trans/trans/debuginfo/utils.rs rename to src/librustc_trans/debuginfo/utils.rs index c1d7bb495fa..d2ae74569e7 100644 --- a/src/librustc_trans/trans/debuginfo/utils.rs +++ b/src/librustc_trans/debuginfo/utils.rs @@ -17,9 +17,9 @@ use middle::def_id::DefId; use llvm; use llvm::debuginfo::{DIScope, DIBuilderRef, DIDescriptor, DIArray}; -use trans::machine; -use trans::common::{CrateContext, FunctionContext}; -use trans::type_::Type; +use machine; +use common::{CrateContext, FunctionContext}; +use type_::Type; use syntax::codemap::Span; use syntax::{ast, codemap}; diff --git a/src/librustc_trans/trans/declare.rs b/src/librustc_trans/declare.rs similarity index 97% rename from src/librustc_trans/trans/declare.rs rename to src/librustc_trans/declare.rs index e63f17770bc..28a70fd5e0b 100644 --- a/src/librustc_trans/trans/declare.rs +++ b/src/librustc_trans/declare.rs @@ -20,12 +20,12 @@ //! * Use define_* family of methods when you might be defining the ValueRef. //! * When in doubt, define. use llvm::{self, ValueRef}; -use middle::ty; -use middle::infer; -use trans::abi::{Abi, FnType}; -use trans::attributes; -use trans::context::CrateContext; -use trans::type_::Type; +use rustc::ty; +use rustc::infer; +use abi::{Abi, FnType}; +use attributes; +use context::CrateContext; +use type_::Type; use std::ffi::CString; use libc::c_uint; diff --git a/src/librustc_trans/trans/disr.rs b/src/librustc_trans/disr.rs similarity index 93% rename from src/librustc_trans/trans/disr.rs rename to src/librustc_trans/disr.rs index d74c1ac50ad..fc79fa813aa 100644 --- a/src/librustc_trans/trans/disr.rs +++ b/src/librustc_trans/disr.rs @@ -24,8 +24,8 @@ impl ::std::ops::BitAnd for Disr { } } -impl From<::middle::ty::Disr> for Disr { - fn from(i: ::middle::ty::Disr) -> Disr { +impl From<::rustc::ty::Disr> for Disr { + fn from(i: ::rustc::ty::Disr) -> Disr { Disr(i.to_u64_unchecked()) } } diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/expr.rs similarity index 99% rename from src/librustc_trans/trans/expr.rs rename to src/librustc_trans/expr.rs index fe98fa29021..b2e2e93a2be 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/expr.rs @@ -54,31 +54,31 @@ use self::lazy_binop_ty::*; use llvm::{self, ValueRef, TypeKind}; use middle::const_qualif::ConstQualif; use middle::def::Def; -use middle::subst::Substs; -use trans::{_match, abi, adt, asm, base, closure, consts, controlflow}; -use trans::base::*; -use trans::build::*; -use trans::callee::{Callee, ArgExprs, ArgOverloadedCall, ArgOverloadedOp}; -use trans::cleanup::{self, CleanupMethods, DropHintMethods}; -use trans::common::*; -use trans::datum::*; -use trans::debuginfo::{self, DebugLoc, ToDebugLoc}; -use trans::declare; -use trans::glue; -use trans::machine; -use trans::tvec; -use trans::type_of; -use trans::value::Value; -use trans::Disr; -use middle::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer}; -use middle::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; -use middle::ty::adjustment::CustomCoerceUnsized; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::MethodCall; -use middle::ty::cast::{CastKind, CastTy}; +use rustc::ty::subst::Substs; +use {_match, abi, adt, asm, base, closure, consts, controlflow}; +use base::*; +use build::*; +use callee::{Callee, ArgExprs, ArgOverloadedCall, ArgOverloadedOp}; +use cleanup::{self, CleanupMethods, DropHintMethods}; +use common::*; +use datum::*; +use debuginfo::{self, DebugLoc, ToDebugLoc}; +use declare; +use glue; +use machine; +use tvec; +use type_of; +use value::Value; +use Disr; +use rustc::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer}; +use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; +use rustc::ty::adjustment::CustomCoerceUnsized; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::MethodCall; +use rustc::ty::cast::{CastKind, CastTy}; use util::common::indenter; -use trans::machine::{llsize_of, llsize_of_alloc}; -use trans::type_::Type; +use machine::{llsize_of, llsize_of_alloc}; +use type_::Type; use rustc_front; use rustc_front::hir; @@ -1859,8 +1859,8 @@ fn trans_imm_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, id: ast::NodeId) -> DatumBlock<'blk, 'tcx, Expr> { - use middle::ty::cast::CastTy::*; - use middle::ty::cast::IntTy::*; + use rustc::ty::cast::CastTy::*; + use rustc::ty::cast::IntTy::*; fn int_cast(bcx: Block, lldsttype: Type, @@ -2194,7 +2194,7 @@ impl OverflowOpViaIntrinsic { fn to_intrinsic_name(&self, tcx: &TyCtxt, ty: Ty) -> &'static str { use syntax::ast::IntTy::*; use syntax::ast::UintTy::*; - use middle::ty::{TyInt, TyUint}; + use rustc::ty::{TyInt, TyUint}; let new_sty = match ty.sty { TyInt(Is) => match &tcx.sess.target.target.target_pointer_width[..] { diff --git a/src/librustc_trans/trans/glue.rs b/src/librustc_trans/glue.rs similarity index 97% rename from src/librustc_trans/trans/glue.rs rename to src/librustc_trans/glue.rs index aa205898114..1af816845b0 100644 --- a/src/librustc_trans/trans/glue.rs +++ b/src/librustc_trans/glue.rs @@ -18,27 +18,27 @@ use back::symbol_names; use llvm; use llvm::{ValueRef, get_param}; use middle::lang_items::ExchangeFreeFnLangItem; -use middle::subst::{Substs}; -use middle::traits; -use middle::ty::{self, Ty, TyCtxt}; -use trans::abi::{Abi, FnType}; -use trans::adt; -use trans::adt::GetDtorType; // for tcx.dtor_type() -use trans::base::*; -use trans::build::*; -use trans::callee::{Callee, ArgVals}; -use trans::cleanup; -use trans::cleanup::CleanupMethods; -use trans::collector::{self, TransItem}; -use trans::common::*; -use trans::debuginfo::DebugLoc; -use trans::declare; -use trans::expr; -use trans::machine::*; -use trans::monomorphize; -use trans::type_of::{type_of, sizing_type_of, align_of}; -use trans::type_::Type; -use trans::value::Value; +use rustc::ty::subst::{Substs}; +use rustc::traits; +use rustc::ty::{self, Ty, TyCtxt}; +use abi::{Abi, FnType}; +use adt; +use adt::GetDtorType; // for tcx.dtor_type() +use base::*; +use build::*; +use callee::{Callee, ArgVals}; +use cleanup; +use cleanup::CleanupMethods; +use collector::{self, TransItem}; +use common::*; +use debuginfo::DebugLoc; +use declare; +use expr; +use machine::*; +use monomorphize; +use type_of::{type_of, sizing_type_of, align_of}; +use type_::Type; +use value::Value; use arena::TypedArena; use syntax::codemap::DUMMY_SP; diff --git a/src/librustc_trans/trans/inline.rs b/src/librustc_trans/inline.rs similarity index 98% rename from src/librustc_trans/trans/inline.rs rename to src/librustc_trans/inline.rs index a9c94a4522b..cf1542b7b03 100644 --- a/src/librustc_trans/trans/inline.rs +++ b/src/librustc_trans/inline.rs @@ -11,10 +11,10 @@ use llvm::{AvailableExternallyLinkage, InternalLinkage, SetLinkage}; use middle::cstore::{CrateStore, FoundAst, InlinedItem}; use middle::def_id::DefId; -use middle::subst::Substs; -use trans::base::{push_ctxt, trans_item, trans_fn}; -use trans::callee::Callee; -use trans::common::*; +use rustc::ty::subst::Substs; +use base::{push_ctxt, trans_item, trans_fn}; +use callee::Callee; +use common::*; use rustc::dep_graph::DepNode; use rustc_front::hir; diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/intrinsic.rs similarity index 99% rename from src/librustc_trans/trans/intrinsic.rs rename to src/librustc_trans/intrinsic.rs index 9bc07c6cd86..b7b74e44d3e 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/intrinsic.rs @@ -15,30 +15,30 @@ use intrinsics::{self, Intrinsic}; use libc; use llvm; use llvm::{ValueRef, TypeKind}; -use middle::infer; -use middle::subst; -use middle::subst::FnSpace; -use trans::abi::{Abi, FnType}; -use trans::adt; -use trans::attributes; -use trans::base::*; -use trans::build::*; -use trans::callee::{self, Callee}; -use trans::cleanup; -use trans::cleanup::CleanupMethods; -use trans::common::*; -use trans::consts; -use trans::datum::*; -use trans::debuginfo::DebugLoc; -use trans::declare; -use trans::expr; -use trans::glue; -use trans::type_of; -use trans::machine; -use trans::type_::Type; -use middle::ty::{self, Ty, TypeFoldable}; -use trans::Disr; -use middle::subst::Substs; +use rustc::infer; +use rustc::ty::subst; +use rustc::ty::subst::FnSpace; +use abi::{Abi, FnType}; +use adt; +use attributes; +use base::*; +use build::*; +use callee::{self, Callee}; +use cleanup; +use cleanup::CleanupMethods; +use common::*; +use consts; +use datum::*; +use debuginfo::DebugLoc; +use declare; +use expr; +use glue; +use type_of; +use machine; +use type_::Type; +use rustc::ty::{self, Ty, TypeFoldable}; +use Disr; +use rustc::ty::subst::Substs; use rustc::dep_graph::DepNode; use rustc_front::hir; use syntax::ast; @@ -1694,7 +1694,7 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a> // Returns None if the type is not an integer fn int_type_width_signed<'tcx>(sty: &ty::TypeVariants<'tcx>, ccx: &CrateContext) -> Option<(u64, bool)> { - use rustc::middle::ty::{TyInt, TyUint}; + use rustc::ty::{TyInt, TyUint}; match *sty { TyInt(t) => Some((match t { ast::IntTy::Is => { @@ -1730,7 +1730,7 @@ fn int_type_width_signed<'tcx>(sty: &ty::TypeVariants<'tcx>, ccx: &CrateContext) // Returns None if the type is not a float fn float_type_width<'tcx>(sty: &ty::TypeVariants<'tcx>) -> Option { - use rustc::middle::ty::TyFloat; + use rustc::ty::TyFloat; match *sty { TyFloat(t) => Some(match t { ast::FloatTy::F32 => 32, diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index b9f92bcc4d9..103de7e42af 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -61,6 +61,9 @@ pub use rustc::middle; pub use rustc::lint; pub use rustc::util; +pub use base::trans_crate; +pub use disr::Disr; + pub mod back { pub use rustc_back::rpath; pub use rustc_back::svh; @@ -76,11 +79,70 @@ pub mod back { pub mod diagnostics; -pub mod trans; -pub mod save; +#[macro_use] +mod macros; -pub mod lib { - pub use llvm; +mod abi; +mod adt; +mod asm; +mod assert_dep_graph; +mod attributes; +mod base; +mod basic_block; +mod build; +mod builder; +mod cabi_aarch64; +mod cabi_arm; +mod cabi_asmjs; +mod cabi_mips; +mod cabi_powerpc; +mod cabi_powerpc64; +mod cabi_x86; +mod cabi_x86_64; +mod cabi_x86_win64; +mod callee; +mod cleanup; +mod closure; +mod common; +mod consts; +mod context; +mod controlflow; +mod datum; +mod debuginfo; +mod declare; +mod disr; +mod expr; +mod glue; +mod inline; +mod intrinsic; +mod machine; +mod _match; +mod meth; +mod mir; +mod monomorphize; +mod collector; +mod symbol_names_test; +mod tvec; +mod type_; +mod type_of; +mod value; + +#[derive(Copy, Clone)] +pub struct ModuleTranslation { + pub llcx: llvm::ContextRef, + pub llmod: llvm::ModuleRef, +} + +unsafe impl Send for ModuleTranslation { } +unsafe impl Sync for ModuleTranslation { } + +pub struct CrateTranslation { + pub modules: Vec, + pub metadata_module: ModuleTranslation, + pub link: middle::cstore::LinkMeta, + pub metadata: Vec, + pub reachable: Vec, + pub no_builtins: bool, } __build_diagnostic_array! { librustc_trans, DIAGNOSTICS } diff --git a/src/librustc_trans/trans/machine.rs b/src/librustc_trans/machine.rs similarity index 98% rename from src/librustc_trans/trans/machine.rs rename to src/librustc_trans/machine.rs index 691fba42d57..59020b38ddc 100644 --- a/src/librustc_trans/trans/machine.rs +++ b/src/librustc_trans/machine.rs @@ -13,9 +13,9 @@ #![allow(non_camel_case_types)] use llvm::{self, ValueRef}; -use trans::common::*; +use common::*; -use trans::type_::Type; +use type_::Type; pub type llbits = u64; pub type llsize = u64; diff --git a/src/librustc_trans/trans/macros.rs b/src/librustc_trans/macros.rs similarity index 100% rename from src/librustc_trans/trans/macros.rs rename to src/librustc_trans/macros.rs diff --git a/src/librustc_trans/trans/meth.rs b/src/librustc_trans/meth.rs similarity index 95% rename from src/librustc_trans/trans/meth.rs rename to src/librustc_trans/meth.rs index f45de10bca8..65f52fd0799 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/meth.rs @@ -14,26 +14,26 @@ use arena::TypedArena; use back::symbol_names; use llvm::{ValueRef, get_params}; use middle::def_id::DefId; -use middle::infer; -use middle::subst::{FnSpace, Subst, Substs}; -use middle::subst; -use middle::traits::{self, ProjectionMode}; -use trans::abi::FnType; -use trans::base::*; -use trans::build::*; -use trans::callee::{Callee, Virtual, ArgVals, trans_fn_pointer_shim}; -use trans::closure; -use trans::common::*; -use trans::consts; -use trans::debuginfo::DebugLoc; -use trans::declare; -use trans::expr; -use trans::glue; -use trans::machine; -use trans::type_::Type; -use trans::type_of::*; -use trans::value::Value; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +use rustc::infer; +use rustc::ty::subst::{FnSpace, Subst, Substs}; +use rustc::ty::subst; +use rustc::traits::{self, ProjectionMode}; +use abi::FnType; +use base::*; +use build::*; +use callee::{Callee, Virtual, ArgVals, trans_fn_pointer_shim}; +use closure; +use common::*; +use consts; +use debuginfo::DebugLoc; +use declare; +use expr; +use glue; +use machine; +use type_::Type; +use type_of::*; +use value::Value; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use syntax::ast::Name; use syntax::codemap::DUMMY_SP; diff --git a/src/librustc_trans/trans/mir/analyze.rs b/src/librustc_trans/mir/analyze.rs similarity index 99% rename from src/librustc_trans/trans/mir/analyze.rs rename to src/librustc_trans/mir/analyze.rs index 23cca55e4d4..9aa3d6c7dd0 100644 --- a/src/librustc_trans/trans/mir/analyze.rs +++ b/src/librustc_trans/mir/analyze.rs @@ -14,7 +14,7 @@ use rustc_data_structures::bitvec::BitVector; use rustc::mir::repr as mir; use rustc::mir::visit::{Visitor, LvalueContext}; -use trans::common::{self, Block}; +use common::{self, Block}; use super::rvalue; pub fn lvalue_temps<'bcx,'tcx>(bcx: Block<'bcx,'tcx>, diff --git a/src/librustc_trans/trans/mir/block.rs b/src/librustc_trans/mir/block.rs similarity index 97% rename from src/librustc_trans/trans/mir/block.rs rename to src/librustc_trans/mir/block.rs index 7abaeb44c1c..a60b03dd724 100644 --- a/src/librustc_trans/trans/mir/block.rs +++ b/src/librustc_trans/mir/block.rs @@ -9,21 +9,21 @@ // except according to those terms. use llvm::{self, BasicBlockRef, ValueRef, OperandBundleDef}; -use rustc::middle::ty; +use rustc::ty; use rustc::mir::repr as mir; -use trans::abi::{Abi, FnType}; -use trans::adt; -use trans::base; -use trans::build; -use trans::callee::{Callee, CalleeData, Fn, Intrinsic, NamedTupleConstructor, Virtual}; -use trans::common::{self, Block, BlockAndBuilder, C_undef}; -use trans::debuginfo::DebugLoc; -use trans::Disr; -use trans::machine::{llalign_of_min, llbitsize_of_real}; -use trans::meth; -use trans::type_of; -use trans::glue; -use trans::type_::Type; +use abi::{Abi, FnType}; +use adt; +use base; +use build; +use callee::{Callee, CalleeData, Fn, Intrinsic, NamedTupleConstructor, Virtual}; +use common::{self, Block, BlockAndBuilder, C_undef}; +use debuginfo::DebugLoc; +use Disr; +use machine::{llalign_of_min, llbitsize_of_real}; +use meth; +use type_of; +use glue; +use type_::Type; use super::{MirContext, drop}; use super::lvalue::{LvalueRef, load_fat_ptr}; @@ -265,9 +265,9 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> { callee.reify(bcx.ccx()).val } Intrinsic => { - use trans::callee::ArgVals; - use trans::expr::{Ignore, SaveIn}; - use trans::intrinsic::trans_intrinsic_call; + use callee::ArgVals; + use expr::{Ignore, SaveIn}; + use intrinsic::trans_intrinsic_call; let (dest, llargs) = if fn_ty.ret.is_indirect() { (SaveIn(llargs[0]), &llargs[1..]) diff --git a/src/librustc_trans/trans/mir/constant.rs b/src/librustc_trans/mir/constant.rs similarity index 96% rename from src/librustc_trans/trans/mir/constant.rs rename to src/librustc_trans/mir/constant.rs index d4934718d75..be1c3f3b56b 100644 --- a/src/librustc_trans/trans/mir/constant.rs +++ b/src/librustc_trans/mir/constant.rs @@ -9,18 +9,18 @@ // except according to those terms. use llvm::ValueRef; -use middle::ty::{Ty, TypeFoldable}; +use rustc::ty::{Ty, TypeFoldable}; use rustc::middle::const_eval::{self, ConstVal}; use rustc_const_eval::ConstInt::*; use rustc::mir::repr as mir; -use trans::abi; -use trans::common::{self, BlockAndBuilder, C_bool, C_bytes, C_floating_f64, C_integral, +use abi; +use common::{self, BlockAndBuilder, C_bool, C_bytes, C_floating_f64, C_integral, C_str_slice, C_undef}; -use trans::consts; -use trans::datum; -use trans::expr; -use trans::type_of; -use trans::type_::Type; +use consts; +use datum; +use expr; +use type_of; +use type_::Type; use super::operand::{OperandRef, OperandValue}; use super::MirContext; diff --git a/src/librustc_trans/trans/mir/drop.rs b/src/librustc_trans/mir/drop.rs similarity index 85% rename from src/librustc_trans/trans/mir/drop.rs rename to src/librustc_trans/mir/drop.rs index 2e13abec5e3..623cd5a6f8c 100644 --- a/src/librustc_trans/trans/mir/drop.rs +++ b/src/librustc_trans/mir/drop.rs @@ -9,13 +9,13 @@ // except according to those terms. use llvm::ValueRef; -use rustc::middle::ty::Ty; -use trans::adt; -use trans::base; -use trans::common::{self, BlockAndBuilder}; -use trans::machine; -use trans::type_of; -use trans::type_::Type; +use rustc::ty::Ty; +use adt; +use base; +use common::{self, BlockAndBuilder}; +use machine; +use type_of; +use type_::Type; pub fn drop_fill<'bcx, 'tcx>(bcx: &BlockAndBuilder<'bcx, 'tcx>, value: ValueRef, ty: Ty<'tcx>) { let llty = type_of::type_of(bcx.ccx(), ty); diff --git a/src/librustc_trans/trans/mir/lvalue.rs b/src/librustc_trans/mir/lvalue.rs similarity index 97% rename from src/librustc_trans/trans/mir/lvalue.rs rename to src/librustc_trans/mir/lvalue.rs index ffc3b120674..f5f8c23a982 100644 --- a/src/librustc_trans/trans/mir/lvalue.rs +++ b/src/librustc_trans/mir/lvalue.rs @@ -9,19 +9,19 @@ // except according to those terms. use llvm::ValueRef; -use rustc::middle::ty::{self, Ty, TypeFoldable}; +use rustc::ty::{self, Ty, TypeFoldable}; use rustc::mir::repr as mir; use rustc::mir::tcx::LvalueTy; -use trans::abi; -use trans::adt; -use trans::base; -use trans::builder::Builder; -use trans::common::{self, BlockAndBuilder, C_uint}; -use trans::consts; -use trans::machine; -use trans::mir::drop; +use abi; +use adt; +use base; +use builder::Builder; +use common::{self, BlockAndBuilder, C_uint}; +use consts; +use machine; +use mir::drop; use llvm; -use trans::Disr; +use Disr; use std::ptr; diff --git a/src/librustc_trans/trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs similarity index 98% rename from src/librustc_trans/trans/mir/mod.rs rename to src/librustc_trans/mir/mod.rs index 9df2cb712b1..61536f3ecae 100644 --- a/src/librustc_trans/trans/mir/mod.rs +++ b/src/librustc_trans/mir/mod.rs @@ -10,11 +10,11 @@ use libc::c_uint; use llvm::{self, ValueRef}; -use middle::ty; +use rustc::ty; use rustc::mir::repr as mir; use rustc::mir::tcx::LvalueTy; -use trans::base; -use trans::common::{self, Block, BlockAndBuilder, FunctionContext}; +use base; +use common::{self, Block, BlockAndBuilder, FunctionContext}; use std::ops::Deref; use std::rc::Rc; diff --git a/src/librustc_trans/trans/mir/operand.rs b/src/librustc_trans/mir/operand.rs similarity index 97% rename from src/librustc_trans/trans/mir/operand.rs rename to src/librustc_trans/mir/operand.rs index 6df4502fbc8..3b909353f73 100644 --- a/src/librustc_trans/trans/mir/operand.rs +++ b/src/librustc_trans/mir/operand.rs @@ -9,13 +9,13 @@ // except according to those terms. use llvm::ValueRef; -use rustc::middle::ty::Ty; +use rustc::ty::Ty; use rustc::mir::repr as mir; -use trans::base; -use trans::common::{self, Block, BlockAndBuilder}; -use trans::datum; -use trans::value::Value; -use trans::glue; +use base; +use common::{self, Block, BlockAndBuilder}; +use datum; +use value::Value; +use glue; use std::fmt; diff --git a/src/librustc_trans/trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs similarity index 98% rename from src/librustc_trans/trans/mir/rvalue.rs rename to src/librustc_trans/mir/rvalue.rs index 17c8aef244b..47fa618ebad 100644 --- a/src/librustc_trans/trans/mir/rvalue.rs +++ b/src/librustc_trans/mir/rvalue.rs @@ -9,26 +9,26 @@ // except according to those terms. use llvm::ValueRef; -use rustc::middle::ty::{self, Ty}; -use middle::ty::cast::{CastTy, IntTy}; +use rustc::ty::{self, Ty}; +use rustc::ty::cast::{CastTy, IntTy}; use middle::const_eval::ConstVal; use rustc_const_eval::ConstInt; use rustc::mir::repr as mir; -use trans::asm; -use trans::base; -use trans::callee::Callee; -use trans::common::{self, C_uint, BlockAndBuilder, Result}; -use trans::datum::{Datum, Lvalue}; -use trans::debuginfo::DebugLoc; -use trans::declare; -use trans::adt; -use trans::machine; -use trans::type_::Type; -use trans::type_of; -use trans::tvec; -use trans::value::Value; -use trans::Disr; +use asm; +use base; +use callee::Callee; +use common::{self, C_uint, BlockAndBuilder, Result}; +use datum::{Datum, Lvalue}; +use debuginfo::DebugLoc; +use declare; +use adt; +use machine; +use type_::Type; +use type_of; +use tvec; +use value::Value; +use Disr; use super::MirContext; use super::operand::{OperandRef, OperandValue}; @@ -138,7 +138,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> { use syntax::ast::DUMMY_NODE_ID; use syntax::codemap::DUMMY_SP; use syntax::ptr::P; - use trans::closure; + use closure; closure::trans_closure_expr(closure::Dest::Ignore(bcx.ccx()), &hir::FnDecl { diff --git a/src/librustc_trans/trans/mir/statement.rs b/src/librustc_trans/mir/statement.rs similarity index 98% rename from src/librustc_trans/trans/mir/statement.rs rename to src/librustc_trans/mir/statement.rs index 0307fd649c8..d291bc19db5 100644 --- a/src/librustc_trans/trans/mir/statement.rs +++ b/src/librustc_trans/mir/statement.rs @@ -9,7 +9,7 @@ // except according to those terms. use rustc::mir::repr as mir; -use trans::common::BlockAndBuilder; +use common::BlockAndBuilder; use super::MirContext; use super::TempRef; diff --git a/src/librustc_trans/trans/monomorphize.rs b/src/librustc_trans/monomorphize.rs similarity index 95% rename from src/librustc_trans/trans/monomorphize.rs rename to src/librustc_trans/monomorphize.rs index 6dd8d651012..fe3ab58761a 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/monomorphize.rs @@ -12,18 +12,17 @@ use back::symbol_names; use llvm::ValueRef; use llvm; use middle::def_id::DefId; -use middle::infer::normalize_associated_type; -use middle::subst; -use middle::subst::{Subst, Substs}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::fold::{TypeFolder, TypeFoldable}; -use trans::attributes; -use trans::base::{push_ctxt}; -use trans::base::trans_fn; -use trans::base; -use trans::common::*; -use trans::declare; -use trans::Disr; +use rustc::infer::normalize_associated_type; +use rustc::ty::subst; +use rustc::ty::subst::{Subst, Substs}; +use rustc::ty::{self, Ty, TypeFoldable, TyCtxt}; +use attributes; +use base::{push_ctxt}; +use base::trans_fn; +use base; +use common::*; +use declare; +use Disr; use rustc::front::map as hir_map; use rustc::util::ppaux; diff --git a/src/librustc_trans/trans/symbol_names_test.rs b/src/librustc_trans/symbol_names_test.rs similarity index 81% rename from src/librustc_trans/trans/symbol_names_test.rs rename to src/librustc_trans/symbol_names_test.rs index 63abbfd53b6..a75b6f736ee 100644 --- a/src/librustc_trans/trans/symbol_names_test.rs +++ b/src/librustc_trans/symbol_names_test.rs @@ -15,13 +15,13 @@ //! paths etc in all kinds of annoying scenarios. use back::symbol_names; -use rustc::middle::ty::TyCtxt; use rustc_front::hir; use rustc_front::intravisit::{self, Visitor}; use syntax::ast; use syntax::attr::AttrMetaMethods; -use trans::common::CrateContext; -use trans::monomorphize::Instance; + +use common::CrateContext; +use monomorphize::Instance; const SYMBOL_NAME: &'static str = "rustc_symbol_name"; const ITEM_PATH: &'static str = "rustc_item_path"; @@ -36,28 +36,28 @@ pub fn report_symbol_names(ccx: &CrateContext) { } let _ignore = tcx.dep_graph.in_ignore(); - let mut visitor = SymbolNamesTest { ccx: ccx, tcx: tcx }; + let mut visitor = SymbolNamesTest { ccx: ccx }; tcx.map.krate().visit_all_items(&mut visitor); } struct SymbolNamesTest<'a, 'tcx:'a> { ccx: &'a CrateContext<'a, 'tcx>, - tcx: &'a TyCtxt<'tcx>, } impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> { fn process_attrs(&mut self, node_id: ast::NodeId) { - let def_id = self.tcx.map.local_def_id(node_id); - for attr in self.tcx.get_attrs(def_id).iter() { + let tcx = self.ccx.tcx(); + let def_id = tcx.map.local_def_id(node_id); + for attr in tcx.get_attrs(def_id).iter() { if attr.check_name(SYMBOL_NAME) { // for now, can only use on monomorphic names - let instance = Instance::mono(self.tcx, def_id); + let instance = Instance::mono(tcx, def_id); let name = symbol_names::exported_name(self.ccx, &instance); - self.tcx.sess.span_err(attr.span, &format!("symbol-name({})", name)); + tcx.sess.span_err(attr.span, &format!("symbol-name({})", name)); } else if attr.check_name(ITEM_PATH) { - let path = self.tcx.item_path_str(def_id); - self.tcx.sess.span_err(attr.span, &format!("item-path({})", path)); + let path = tcx.item_path_str(def_id); + tcx.sess.span_err(attr.span, &format!("item-path({})", path)); } // (*) The formatting of `tag({})` is chosen so that tests can elect diff --git a/src/librustc_trans/trans/mod.rs b/src/librustc_trans/trans/mod.rs deleted file mode 100644 index 930f37ce256..00000000000 --- a/src/librustc_trans/trans/mod.rs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use llvm::{ContextRef, ModuleRef}; -use middle::cstore::LinkMeta; - -pub use self::base::trans_crate; -pub use self::context::CrateContext; -pub use self::common::gensym_name; -pub use self::disr::Disr; -pub use self::monomorphize::Instance; - -#[macro_use] -mod macros; - -mod abi; -mod adt; -mod asm; -mod assert_dep_graph; -mod attributes; -mod base; -mod basic_block; -mod build; -mod builder; -mod cabi_aarch64; -mod cabi_arm; -mod cabi_asmjs; -mod cabi_mips; -mod cabi_powerpc; -mod cabi_powerpc64; -mod cabi_x86; -mod cabi_x86_64; -mod cabi_x86_win64; -mod callee; -mod cleanup; -mod closure; -mod common; -mod consts; -mod context; -mod controlflow; -mod datum; -mod debuginfo; -mod declare; -mod disr; -mod expr; -mod glue; -mod inline; -mod intrinsic; -mod machine; -mod _match; -mod meth; -mod mir; -mod monomorphize; -mod collector; -mod symbol_names_test; -mod tvec; -mod type_; -mod type_of; -mod value; - -#[derive(Copy, Clone)] -pub struct ModuleTranslation { - pub llcx: ContextRef, - pub llmod: ModuleRef, -} - -unsafe impl Send for ModuleTranslation { } -unsafe impl Sync for ModuleTranslation { } - -pub struct CrateTranslation { - pub modules: Vec, - pub metadata_module: ModuleTranslation, - pub link: LinkMeta, - pub metadata: Vec, - pub reachable: Vec, - pub no_builtins: bool, -} diff --git a/src/librustc_trans/trans/tvec.rs b/src/librustc_trans/tvec.rs similarity index 97% rename from src/librustc_trans/trans/tvec.rs rename to src/librustc_trans/tvec.rs index 7a0ca86f5a2..c42bad0bc0b 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/tvec.rs @@ -12,22 +12,22 @@ use llvm; use llvm::ValueRef; -use trans::base::*; -use trans::base; -use trans::build::*; -use trans::cleanup; -use trans::cleanup::CleanupMethods; -use trans::common::*; -use trans::consts; -use trans::datum::*; -use trans::debuginfo::DebugLoc; -use trans::expr::{Dest, Ignore, SaveIn}; -use trans::expr; -use trans::machine::llsize_of_alloc; -use trans::type_::Type; -use trans::type_of; -use trans::value::Value; -use middle::ty::{self, Ty}; +use base::*; +use base; +use build::*; +use cleanup; +use cleanup::CleanupMethods; +use common::*; +use consts; +use datum::*; +use debuginfo::DebugLoc; +use expr::{Dest, Ignore, SaveIn}; +use expr; +use machine::llsize_of_alloc; +use type_::Type; +use type_of; +use value::Value; +use rustc::ty::{self, Ty}; use rustc_front::hir; diff --git a/src/librustc_trans/trans/type_.rs b/src/librustc_trans/type_.rs similarity index 99% rename from src/librustc_trans/trans/type_.rs rename to src/librustc_trans/type_.rs index 57bd0ba8158..910a1c7f729 100644 --- a/src/librustc_trans/trans/type_.rs +++ b/src/librustc_trans/type_.rs @@ -14,7 +14,7 @@ use llvm; use llvm::{TypeRef, Bool, False, True, TypeKind}; use llvm::{Float, Double, X86_FP80, PPC_FP128, FP128}; -use trans::context::CrateContext; +use context::CrateContext; use util::nodemap::FnvHashMap; use syntax::ast; diff --git a/src/librustc_trans/trans/type_of.rs b/src/librustc_trans/type_of.rs similarity index 97% rename from src/librustc_trans/trans/type_of.rs rename to src/librustc_trans/type_of.rs index 7d5218d84da..02f659fdc2e 100644 --- a/src/librustc_trans/trans/type_of.rs +++ b/src/librustc_trans/type_of.rs @@ -11,15 +11,15 @@ #![allow(non_camel_case_types)] use middle::def_id::DefId; -use middle::infer; -use middle::subst; -use trans::abi::FnType; -use trans::adt; -use trans::common::*; -use trans::machine; -use middle::ty::{self, Ty, TypeFoldable}; +use rustc::infer; +use rustc::ty::subst; +use abi::FnType; +use adt; +use common::*; +use machine; +use rustc::ty::{self, Ty, TypeFoldable}; -use trans::type_::Type; +use type_::Type; use syntax::ast; @@ -145,7 +145,7 @@ pub fn immediate_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> } } -/// Get the LLVM type corresponding to a Rust type, i.e. `middle::ty::Ty`. +/// Get the LLVM type corresponding to a Rust type, i.e. `rustc::ty::Ty`. /// This is the right LLVM type for an alloca containing a value of that type, /// and the pointee of an Lvalue Datum (which is always a LLVM pointer). /// For unsized types, the returned type is a fat pointer, thus the resulting @@ -163,7 +163,7 @@ pub fn type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -> Type { in_memory_type_of(cx, ty) } -/// Get the LLVM type corresponding to a Rust type, i.e. `middle::ty::Ty`. +/// Get the LLVM type corresponding to a Rust type, i.e. `rustc::ty::Ty`. /// This is the right LLVM type for a field/array element of that type, /// and is the same as `type_of` for all Sized types. /// Unsized types, however, are represented by a "minimal unit", e.g. diff --git a/src/librustc_trans/trans/value.rs b/src/librustc_trans/value.rs similarity index 98% rename from src/librustc_trans/trans/value.rs rename to src/librustc_trans/value.rs index a33b7d62d2d..00b316cc420 100644 --- a/src/librustc_trans/trans/value.rs +++ b/src/librustc_trans/value.rs @@ -10,8 +10,8 @@ use llvm; use llvm::{UseRef, ValueRef}; -use trans::basic_block::BasicBlock; -use trans::common::Block; +use basic_block::BasicBlock; +use common::Block; use std::fmt; diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 159ff90b509..af40b845767 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -54,10 +54,10 @@ use middle::const_eval::EvalHint::UncheckedExprHint; use middle::def::{self, Def}; use middle::def_id::DefId; use middle::resolve_lifetime as rl; -use middle::subst::{FnSpace, TypeSpace, SelfSpace, Subst, Substs, ParamSpace}; -use middle::traits; -use middle::ty::{self, Ty, TyCtxt, ToPredicate, TypeFoldable}; -use middle::ty::wf::object_region_bounds; +use rustc::ty::subst::{FnSpace, TypeSpace, SelfSpace, Subst, Substs, ParamSpace}; +use rustc::traits; +use rustc::ty::{self, Ty, TyCtxt, ToPredicate, TypeFoldable}; +use rustc::ty::wf::object_region_bounds; use require_c_abi_if_variadic; use rscope::{self, UnelidableRscope, RegionScope, ElidableRscope, ObjectLifetimeDefaultRscope, ShiftedRscope, BindingRscope, diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 305970db9e7..f8fa9c8e9b6 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -9,11 +9,11 @@ // except according to those terms. use middle::def::{self, Def}; -use middle::infer::{self, TypeOrigin}; +use rustc::infer::{self, TypeOrigin}; use middle::pat_util::{PatIdMap, pat_id_map, pat_is_binding}; use middle::pat_util::pat_is_resolved_const; -use middle::subst::Substs; -use middle::ty::{self, Ty, TypeFoldable, LvaluePreference}; +use rustc::ty::subst::Substs; +use rustc::ty::{self, Ty, TypeFoldable, LvaluePreference}; use check::{check_expr, check_expr_has_type, check_expr_with_expectation}; use check::{demand, FnCtxt, Expectation}; use check::{check_expr_with_lvalue_pref}; diff --git a/src/librustc_typeck/check/assoc.rs b/src/librustc_typeck/check/assoc.rs index 91916efa882..f7726bc9cf4 100644 --- a/src/librustc_typeck/check/assoc.rs +++ b/src/librustc_typeck/check/assoc.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::infer::InferCtxt; -use middle::traits::{self, FulfillmentContext, Normalized, MiscObligation, +use rustc::infer::InferCtxt; +use rustc::traits::{self, FulfillmentContext, Normalized, MiscObligation, SelectionContext, ObligationCause}; -use middle::ty::fold::TypeFoldable; +use rustc::ty::fold::TypeFoldable; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/callee.rs b/src/librustc_typeck/check/callee.rs index bf60f435a22..4e582033c8b 100644 --- a/src/librustc_typeck/check/callee.rs +++ b/src/librustc_typeck/check/callee.rs @@ -28,8 +28,8 @@ use CrateCtxt; use middle::cstore::LOCAL_CRATE; use middle::def::Def; use middle::def_id::DefId; -use middle::infer; -use middle::ty::{self, LvaluePreference, Ty}; +use rustc::infer; +use rustc::ty::{self, LvaluePreference, Ty}; use syntax::codemap::Span; use syntax::parse::token; use syntax::ptr::P; diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 31c0fea5c2d..7ca4251e4c8 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -45,8 +45,8 @@ use super::structurally_resolved_type; use lint; use middle::def_id::DefId; -use middle::ty::{self, Ty, TypeFoldable}; -use middle::ty::cast::{CastKind, CastTy}; +use rustc::ty::{self, Ty, TypeFoldable}; +use rustc::ty::cast::{CastKind, CastTy}; use syntax::codemap::Span; use rustc_front::hir; use syntax::ast; @@ -238,8 +238,8 @@ impl<'tcx> CastCheck<'tcx> { /// can return Ok and create type errors in the fcx rather than returning /// directly. coercion-cast is handled in check instead of here. fn do_check<'a>(&self, fcx: &FnCtxt<'a, 'tcx>) -> Result { - use middle::ty::cast::IntTy::*; - use middle::ty::cast::CastTy::*; + use rustc::ty::cast::IntTy::*; + use rustc::ty::cast::CastTy::*; let (t_from, t_cast) = match (CastTy::from_ty(self.expr_ty), CastTy::from_ty(self.cast_ty)) { diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index a4fb2e38145..9333b10d27e 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -13,8 +13,8 @@ use super::{check_fn, Expectation, FnCtxt}; use astconv; -use middle::subst; -use middle::ty::{self, ToPolyTraitRef, Ty}; +use rustc::ty::subst; +use rustc::ty::{self, ToPolyTraitRef, Ty}; use std::cmp; use syntax::abi::Abi; use rustc_front::hir; diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index c62922a33de..dad7d7cd26c 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -62,16 +62,16 @@ use check::{autoderef, FnCtxt, UnresolvedTypeAction}; -use middle::infer::{Coercion, TypeOrigin, TypeTrace}; -use middle::traits::{self, ObligationCause}; -use middle::traits::{predicate_for_trait_def, report_selection_error}; -use middle::ty::adjustment::{AutoAdjustment, AutoDerefRef, AdjustDerefRef}; -use middle::ty::adjustment::{AutoPtr, AutoUnsafe, AdjustReifyFnPointer}; -use middle::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; -use middle::ty::{self, LvaluePreference, TypeAndMut, Ty, TyCtxt}; -use middle::ty::fold::TypeFoldable; -use middle::ty::error::TypeError; -use middle::ty::relate::{relate_substs, Relate, RelateResult, TypeRelation}; +use rustc::infer::{Coercion, TypeOrigin, TypeTrace}; +use rustc::traits::{self, ObligationCause}; +use rustc::traits::{predicate_for_trait_def, report_selection_error}; +use rustc::ty::adjustment::{AutoAdjustment, AutoDerefRef, AdjustDerefRef}; +use rustc::ty::adjustment::{AutoPtr, AutoUnsafe, AdjustReifyFnPointer}; +use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; +use rustc::ty::{self, LvaluePreference, TypeAndMut, Ty, TyCtxt}; +use rustc::ty::fold::TypeFoldable; +use rustc::ty::error::TypeError; +use rustc::ty::relate::{relate_substs, Relate, RelateResult, TypeRelation}; use util::common::indent; use std::cell::RefCell; diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 3e59f0ba73a..6d429fa7b73 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -9,10 +9,10 @@ // except according to those terms. use middle::free_region::FreeRegionMap; -use middle::infer::{self, TypeOrigin}; -use middle::ty::{self, TyCtxt}; -use middle::traits::{self, ProjectionMode}; -use middle::subst::{self, Subst, Substs, VecPerParamSpace}; +use rustc::infer::{self, TypeOrigin}; +use rustc::ty::{self, TyCtxt}; +use rustc::traits::{self, ProjectionMode}; +use rustc::ty::subst::{self, Subst, Substs, VecPerParamSpace}; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index 1f61198bef9..d8bdf6c61aa 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -10,8 +10,8 @@ use check::{coercion, FnCtxt}; -use middle::ty::Ty; -use middle::infer::TypeOrigin; +use rustc::ty::Ty; +use rustc::infer::TypeOrigin; use syntax::codemap::Span; use rustc_front::hir; diff --git a/src/librustc_typeck/check/dropck.rs b/src/librustc_typeck/check/dropck.rs index 7dd5db831fd..bf2388ab793 100644 --- a/src/librustc_typeck/check/dropck.rs +++ b/src/librustc_typeck/check/dropck.rs @@ -12,11 +12,11 @@ use check::regionck::{self, Rcx}; use middle::def_id::DefId; use middle::free_region::FreeRegionMap; -use middle::infer; +use rustc::infer; use middle::region; -use middle::subst::{self, Subst}; -use middle::ty::{self, Ty, TyCtxt}; -use middle::traits::{self, ProjectionMode}; +use rustc::ty::subst::{self, Subst}; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::traits::{self, ProjectionMode}; use util::nodemap::FnvHashSet; use syntax::ast; diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index 2cd166ebe7e..8720469a724 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -13,10 +13,10 @@ use astconv::AstConv; use intrinsics; -use middle::subst::{self, Substs}; -use middle::ty::FnSig; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::fold::TypeFolder; +use rustc::ty::subst::{self, Substs}; +use rustc::ty::FnSig; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::fold::TypeFolder; use {CrateCtxt, require_same_types}; use std::collections::{HashMap}; diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index aa4e1d0b529..310245f0a0e 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -13,13 +13,13 @@ use super::probe; use check::{self, FnCtxt, callee, demand}; use check::UnresolvedTypeAction; use middle::def_id::DefId; -use middle::subst::{self}; -use middle::traits; -use middle::ty::{self, NoPreference, PreferMutLvalue, Ty, TyCtxt}; -use middle::ty::adjustment::{AdjustDerefRef, AutoDerefRef, AutoPtr}; -use middle::ty::fold::TypeFoldable; -use middle::infer; -use middle::infer::{InferCtxt, TypeOrigin}; +use rustc::ty::subst::{self}; +use rustc::traits; +use rustc::ty::{self, NoPreference, PreferMutLvalue, Ty, TyCtxt}; +use rustc::ty::adjustment::{AdjustDerefRef, AutoDerefRef, AutoPtr}; +use rustc::ty::fold::TypeFoldable; +use rustc::infer; +use rustc::infer::{InferCtxt, TypeOrigin}; use syntax::codemap::Span; use rustc_front::hir; diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 7f982c466a7..11f7feba86b 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -14,11 +14,11 @@ use astconv::AstConv; use check::FnCtxt; use middle::def::Def; use middle::def_id::DefId; -use middle::subst; -use middle::traits; -use middle::ty::{self, TyCtxt, ToPredicate, ToPolyTraitRef, TraitRef, TypeFoldable}; -use middle::ty::adjustment::{AdjustDerefRef, AutoDerefRef, AutoPtr}; -use middle::infer; +use rustc::ty::subst; +use rustc::traits; +use rustc::ty::{self, TyCtxt, ToPredicate, ToPolyTraitRef, TraitRef, TypeFoldable}; +use rustc::ty::adjustment::{AdjustDerefRef, AutoDerefRef, AutoPtr}; +use rustc::infer; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 5f7f9703b10..4b42846297b 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -16,12 +16,12 @@ use super::suggest; use check; use check::{FnCtxt, UnresolvedTypeAction}; use middle::def_id::DefId; -use middle::subst; -use middle::subst::Subst; -use middle::traits; -use middle::ty::{self, NoPreference, Ty, TyCtxt, ToPolyTraitRef, TraitRef, TypeFoldable}; -use middle::infer; -use middle::infer::{InferCtxt, TypeOrigin}; +use rustc::ty::subst; +use rustc::ty::subst::Subst; +use rustc::traits; +use rustc::ty::{self, NoPreference, Ty, TyCtxt, ToPolyTraitRef, TraitRef, TypeFoldable}; +use rustc::infer; +use rustc::infer::{InferCtxt, TypeOrigin}; use syntax::ast; use syntax::codemap::{Span, DUMMY_SP}; use rustc_front::hir; diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 44724ca26b1..aae7912cace 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -16,13 +16,13 @@ use CrateCtxt; use astconv::AstConv; use check::{self, FnCtxt}; use front::map as hir_map; -use middle::ty::{self, Ty, ToPolyTraitRef, ToPredicate, TypeFoldable}; +use rustc::ty::{self, Ty, ToPolyTraitRef, ToPredicate, TypeFoldable}; use middle::cstore::{self, CrateStore}; use middle::def::Def; use middle::def_id::DefId; use middle::lang_items::FnOnceTraitLangItem; -use middle::subst::Substs; -use middle::traits::{Obligation, SelectionContext}; +use rustc::ty::subst::Substs; +use rustc::traits::{Obligation, SelectionContext}; use util::nodemap::{FnvHashSet}; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 6eb663e6047..c5a0657594e 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -88,21 +88,21 @@ use middle::astconv_util::prohibit_type_params; use middle::cstore::LOCAL_CRATE; use middle::def::{self, Def}; use middle::def_id::DefId; -use middle::infer; -use middle::infer::{TypeOrigin, TypeTrace, type_variable}; +use rustc::infer; +use rustc::infer::{TypeOrigin, TypeTrace, type_variable}; use middle::pat_util::{self, pat_id_map}; -use middle::subst::{self, Subst, Substs, VecPerParamSpace, ParamSpace}; -use middle::traits::{self, report_fulfillment_errors, ProjectionMode}; -use middle::ty::{GenericPredicates, TypeScheme}; -use middle::ty::{ParamTy, ParameterEnvironment}; -use middle::ty::{LvaluePreference, NoPreference, PreferMutLvalue}; -use middle::ty::{self, ToPolyTraitRef, Ty, TyCtxt}; -use middle::ty::{MethodCall, MethodCallee}; -use middle::ty::adjustment; -use middle::ty::error::TypeError; -use middle::ty::fold::{TypeFolder, TypeFoldable}; -use middle::ty::relate::TypeRelation; -use middle::ty::util::{Representability, IntTypeExt}; +use rustc::ty::subst::{self, Subst, Substs, VecPerParamSpace, ParamSpace}; +use rustc::traits::{self, report_fulfillment_errors, ProjectionMode}; +use rustc::ty::{GenericPredicates, TypeScheme}; +use rustc::ty::{ParamTy, ParameterEnvironment}; +use rustc::ty::{LvaluePreference, NoPreference, PreferMutLvalue}; +use rustc::ty::{self, ToPolyTraitRef, Ty, TyCtxt}; +use rustc::ty::{MethodCall, MethodCallee}; +use rustc::ty::adjustment; +use rustc::ty::error::TypeError; +use rustc::ty::fold::{TypeFolder, TypeFoldable}; +use rustc::ty::relate::TypeRelation; +use rustc::ty::util::{Representability, IntTypeExt}; use require_c_abi_if_variadic; use rscope::{ElisionFailureInfo, RegionScope}; use session::{Session, CompileResult}; @@ -1769,8 +1769,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// Apply "fallbacks" to some types /// ! gets replaced with (), unconstrained ints with i32, and unconstrained floats with f64. fn default_type_parameters(&self) { - use middle::ty::error::UnconstrainedNumeric::Neither; - use middle::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; + use rustc::ty::error::UnconstrainedNumeric::Neither; + use rustc::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; for ty in &self.infcx().unsolved_variables() { let resolved = self.infcx().resolve_type_vars_if_possible(ty); if self.infcx().type_var_diverges(resolved) { @@ -1805,8 +1805,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } fn new_select_all_obligations_and_apply_defaults(&self) { - use middle::ty::error::UnconstrainedNumeric::Neither; - use middle::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; + use rustc::ty::error::UnconstrainedNumeric::Neither; + use rustc::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; // For the time being this errs on the side of being memory wasteful but provides better // error reporting. @@ -1978,8 +1978,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { default_map: &FnvHashMap<&Ty<'tcx>, type_variable::Default<'tcx>>, conflict: Ty<'tcx>) -> Option> { - use middle::ty::error::UnconstrainedNumeric::Neither; - use middle::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; + use rustc::ty::error::UnconstrainedNumeric::Neither; + use rustc::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat}; // Ensure that we apply the conflicting default first let mut unbound_tyvars = Vec::with_capacity(unbound_vars.len() + 1); diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index f4841b75d13..281564af615 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -19,7 +19,7 @@ use super::{ FnCtxt, }; use middle::def_id::DefId; -use middle::ty::{Ty, TypeFoldable, PreferMutLvalue}; +use rustc::ty::{Ty, TypeFoldable, PreferMutLvalue}; use syntax::ast; use syntax::parse::token; use rustc_front::hir; @@ -335,7 +335,7 @@ fn lookup_op_method<'a, 'tcx>(fcx: &'a FnCtxt<'a, 'tcx>, let method_ty = method.ty; // HACK(eddyb) Fully qualified path to work around a resolve bug. - let method_call = ::middle::ty::MethodCall::expr(expr.id); + let method_call = ::rustc::ty::MethodCall::expr(expr.id); fcx.inh.tables.borrow_mut().method_map.insert(method_call, method); // extract return type for method; all late bound regions diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index fb4870bce87..533d24686e7 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -89,13 +89,13 @@ use middle::free_region::FreeRegionMap; use middle::mem_categorization as mc; use middle::mem_categorization::Categorization; use middle::region::{self, CodeExtent}; -use middle::subst::Substs; -use middle::traits; -use middle::ty::{self, Ty, TyCtxt, MethodCall, TypeFoldable}; -use middle::infer::{self, GenericKind, InferCtxt, SubregionOrigin, TypeOrigin, VerifyBound}; +use rustc::ty::subst::Substs; +use rustc::traits; +use rustc::ty::{self, Ty, TyCtxt, MethodCall, TypeFoldable}; +use rustc::infer::{self, GenericKind, InferCtxt, SubregionOrigin, TypeOrigin, VerifyBound}; use middle::pat_util; -use middle::ty::adjustment; -use middle::ty::wf::ImpliedBound; +use rustc::ty::adjustment; +use rustc::ty::wf::ImpliedBound; use std::mem; use syntax::ast; diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index 2bb8c874d20..69e49e6a986 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -46,8 +46,8 @@ use check::demand; use middle::expr_use_visitor as euv; use middle::mem_categorization as mc; use middle::mem_categorization::Categorization; -use middle::ty::{self, Ty, TyCtxt}; -use middle::infer::{InferCtxt, UpvarRegion}; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::infer::{InferCtxt, UpvarRegion}; use std::collections::HashSet; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index a8ada806131..047dfec1796 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -14,10 +14,10 @@ use constrained_type_params::{identify_constrained_type_params, Parameter}; use CrateCtxt; use middle::def_id::DefId; use middle::region::{CodeExtent}; -use middle::subst::{self, TypeSpace, FnSpace, ParamSpace, SelfSpace}; -use middle::traits; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::fold::{TypeFolder}; +use rustc::ty::subst::{self, TypeSpace, FnSpace, ParamSpace, SelfSpace}; +use rustc::traits; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::fold::{TypeFolder}; use std::cell::RefCell; use std::collections::HashSet; diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 20c86f9a17c..7ede85454e9 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -17,10 +17,10 @@ use astconv::AstConv; use check::FnCtxt; use middle::def_id::DefId; use middle::pat_util; -use middle::ty::{self, Ty, TyCtxt, MethodCall, MethodCallee}; -use middle::ty::adjustment; -use middle::ty::fold::{TypeFolder,TypeFoldable}; -use middle::infer; +use rustc::ty::{self, Ty, TyCtxt, MethodCall, MethodCallee}; +use rustc::ty::adjustment; +use rustc::ty::fold::{TypeFolder,TypeFoldable}; +use rustc::infer; use write_substs_to_tcx; use write_ty_to_tcx; diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 278d4d8b5b4..c3b46ef83ac 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -17,21 +17,21 @@ use middle::def_id::DefId; use middle::lang_items::UnsizeTraitLangItem; -use middle::subst::{self, Subst}; -use middle::ty::{self, TyCtxt, TypeFoldable}; -use middle::traits::{self, ProjectionMode}; -use middle::ty::{ImplOrTraitItemId, ConstTraitItemId}; -use middle::ty::{MethodTraitItemId, TypeTraitItemId, ParameterEnvironment}; -use middle::ty::{Ty, TyBool, TyChar, TyEnum, TyError}; -use middle::ty::{TyParam, TyRawPtr}; -use middle::ty::{TyRef, TyStruct, TyTrait, TyTuple}; -use middle::ty::{TyStr, TyArray, TySlice, TyFloat, TyInfer, TyInt}; -use middle::ty::{TyUint, TyClosure, TyBox, TyFnDef, TyFnPtr}; -use middle::ty::TyProjection; -use middle::ty::util::CopyImplementationError; +use rustc::ty::subst::{self, Subst}; +use rustc::ty::{self, TyCtxt, TypeFoldable}; +use rustc::traits::{self, ProjectionMode}; +use rustc::ty::{ImplOrTraitItemId, ConstTraitItemId}; +use rustc::ty::{MethodTraitItemId, TypeTraitItemId, ParameterEnvironment}; +use rustc::ty::{Ty, TyBool, TyChar, TyEnum, TyError}; +use rustc::ty::{TyParam, TyRawPtr}; +use rustc::ty::{TyRef, TyStruct, TyTrait, TyTuple}; +use rustc::ty::{TyStr, TyArray, TySlice, TyFloat, TyInfer, TyInt}; +use rustc::ty::{TyUint, TyClosure, TyBox, TyFnDef, TyFnPtr}; +use rustc::ty::TyProjection; +use rustc::ty::util::CopyImplementationError; use middle::free_region::FreeRegionMap; use CrateCtxt; -use middle::infer::{self, InferCtxt, TypeOrigin, new_infer_ctxt}; +use rustc::infer::{self, InferCtxt, TypeOrigin, new_infer_ctxt}; use std::cell::RefCell; use std::rc::Rc; use syntax::ast; diff --git a/src/librustc_typeck/coherence/orphan.rs b/src/librustc_typeck/coherence/orphan.rs index 56e6d039903..eba3e56c722 100644 --- a/src/librustc_typeck/coherence/orphan.rs +++ b/src/librustc_typeck/coherence/orphan.rs @@ -13,8 +13,8 @@ use middle::cstore::LOCAL_CRATE; use middle::def_id::DefId; -use middle::traits; -use middle::ty::{self, TyCtxt}; +use rustc::traits; +use rustc::ty::{self, TyCtxt}; use syntax::ast; use syntax::codemap::Span; use rustc::dep_graph::DepNode; diff --git a/src/librustc_typeck/coherence/overlap.rs b/src/librustc_typeck/coherence/overlap.rs index 78ae8fa65f8..d7d4560a4ea 100644 --- a/src/librustc_typeck/coherence/overlap.rs +++ b/src/librustc_typeck/coherence/overlap.rs @@ -14,9 +14,9 @@ use middle::cstore::CrateStore; use middle::def_id::DefId; -use middle::traits::{self, ProjectionMode}; -use middle::infer; -use middle::ty::{self, TyCtxt}; +use rustc::traits::{self, ProjectionMode}; +use rustc::infer; +use rustc::ty::{self, TyCtxt}; use syntax::ast; use rustc::dep_graph::DepNode; use rustc_front::hir; diff --git a/src/librustc_typeck/coherence/unsafety.rs b/src/librustc_typeck/coherence/unsafety.rs index fbb1653b06a..6d77200daa3 100644 --- a/src/librustc_typeck/coherence/unsafety.rs +++ b/src/librustc_typeck/coherence/unsafety.rs @@ -11,7 +11,7 @@ //! Unsafety checker: every impl either implements a trait defined in this //! crate or pertains to a type defined in this crate. -use middle::ty::TyCtxt; +use rustc::ty::TyCtxt; use rustc_front::intravisit; use rustc_front::hir; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 3f8f31ce3ce..0b447b2009b 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -68,12 +68,12 @@ use middle::lang_items::SizedTraitLangItem; use middle::resolve_lifetime; use middle::const_eval::{self, ConstVal}; use middle::const_eval::EvalHint::UncheckedExprHint; -use middle::subst::{Substs, FnSpace, ParamSpace, SelfSpace, TypeSpace, VecPerParamSpace}; -use middle::ty::{ToPredicate, ImplContainer, ImplOrTraitItemContainer, TraitContainer}; -use middle::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeScheme}; -use middle::ty::{VariantKind}; -use middle::ty::fold::{TypeFolder}; -use middle::ty::util::IntTypeExt; +use rustc::ty::subst::{Substs, FnSpace, ParamSpace, SelfSpace, TypeSpace, VecPerParamSpace}; +use rustc::ty::{ToPredicate, ImplContainer, ImplOrTraitItemContainer, TraitContainer}; +use rustc::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeScheme}; +use rustc::ty::{VariantKind}; +use rustc::ty::fold::{TypeFolder}; +use rustc::ty::util::IntTypeExt; use rscope::*; use rustc::dep_graph::DepNode; use rustc::front::map as hir_map; diff --git a/src/librustc_typeck/constrained_type_params.rs b/src/librustc_typeck/constrained_type_params.rs index 4446063e0c7..7e8b08c5853 100644 --- a/src/librustc_typeck/constrained_type_params.rs +++ b/src/librustc_typeck/constrained_type_params.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::subst; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::subst; +use rustc::ty::{self, Ty, TyCtxt}; use std::collections::HashSet; diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 4e1f3d3cbb7..9b0fdd8a2e3 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -104,10 +104,10 @@ pub use rustc::util; use dep_graph::DepNode; use front::map as hir_map; use middle::def::Def; -use middle::infer::{self, TypeOrigin}; -use middle::subst::Substs; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; -use middle::traits::ProjectionMode; +use rustc::infer::{self, TypeOrigin}; +use rustc::ty::subst::Substs; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; +use rustc::traits::ProjectionMode; use session::{config, CompileResult}; use util::common::time; use rustc_front::hir; diff --git a/src/librustc_typeck/rscope.rs b/src/librustc_typeck/rscope.rs index 1b02c736dce..793dba1e3f5 100644 --- a/src/librustc_typeck/rscope.rs +++ b/src/librustc_typeck/rscope.rs @@ -9,7 +9,7 @@ // except according to those terms. -use middle::ty; +use rustc::ty; use std::cell::Cell; use syntax::codemap::Span; diff --git a/src/librustc_typeck/variance/constraints.rs b/src/librustc_typeck/variance/constraints.rs index 5c74e9096f3..1ed355c90a5 100644 --- a/src/librustc_typeck/variance/constraints.rs +++ b/src/librustc_typeck/variance/constraints.rs @@ -16,10 +16,10 @@ use dep_graph::DepTrackingMapConfig; use middle::def_id::DefId; use middle::resolve_lifetime as rl; -use middle::subst; -use middle::subst::ParamSpace; -use middle::ty::{self, Ty, TyCtxt}; -use middle::ty::maps::ItemVariances; +use rustc::ty::subst; +use rustc::ty::subst::ParamSpace; +use rustc::ty::{self, Ty, TyCtxt}; +use rustc::ty::maps::ItemVariances; use rustc::front::map as hir_map; use syntax::ast; use rustc_front::hir; diff --git a/src/librustc_typeck/variance/mod.rs b/src/librustc_typeck/variance/mod.rs index ab37ef952c9..ee9f317f20f 100644 --- a/src/librustc_typeck/variance/mod.rs +++ b/src/librustc_typeck/variance/mod.rs @@ -12,7 +12,7 @@ //! parameters. See README.md for details. use arena; -use middle::ty::TyCtxt; +use rustc::ty::TyCtxt; /// Defines the `TermsContext` basically houses an arena where we can /// allocate terms. diff --git a/src/librustc_typeck/variance/solve.rs b/src/librustc_typeck/variance/solve.rs index fd442a4547c..0763cfd7e2e 100644 --- a/src/librustc_typeck/variance/solve.rs +++ b/src/librustc_typeck/variance/solve.rs @@ -15,8 +15,8 @@ //! optimal solution to the constraints. The final variance for each //! inferred is then written into the `variance_map` in the tcx. -use middle::subst::VecPerParamSpace; -use middle::ty; +use rustc::ty::subst::VecPerParamSpace; +use rustc::ty; use std::rc::Rc; use super::constraints::*; diff --git a/src/librustc_typeck/variance/terms.rs b/src/librustc_typeck/variance/terms.rs index ff55aefb20f..c6f82ba42e6 100644 --- a/src/librustc_typeck/variance/terms.rs +++ b/src/librustc_typeck/variance/terms.rs @@ -21,9 +21,9 @@ use arena::TypedArena; use dep_graph::DepTrackingMapConfig; -use middle::subst::{ParamSpace, FnSpace, TypeSpace, SelfSpace, VecPerParamSpace}; -use middle::ty::{self, TyCtxt}; -use middle::ty::maps::ItemVariances; +use rustc::ty::subst::{ParamSpace, FnSpace, TypeSpace, SelfSpace, VecPerParamSpace}; +use rustc::ty::{self, TyCtxt}; +use rustc::ty::maps::ItemVariances; use std::fmt; use std::rc::Rc; use syntax::ast; diff --git a/src/librustc_typeck/variance/xform.rs b/src/librustc_typeck/variance/xform.rs index 2749dce5c73..02a2ceb360d 100644 --- a/src/librustc_typeck/variance/xform.rs +++ b/src/librustc_typeck/variance/xform.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::ty; +use rustc::ty; pub trait Xform { fn xform(self, v: Self) -> Self; diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index e9c55c56a9d..94dead3c005 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -19,8 +19,8 @@ use rustc_front::hir; use rustc::middle::cstore::{self, CrateStore}; use rustc::middle::def::Def; use rustc::middle::def_id::DefId; -use rustc::middle::ty::{self, TyCtxt}; -use rustc::middle::subst; +use rustc::ty::{self, TyCtxt}; +use rustc::ty::subst; use rustc::middle::stability; use rustc::middle::const_eval; diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index aab5c960df3..e56286c8bed 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -38,8 +38,8 @@ use rustc_trans::back::link; use rustc::middle::cstore::{self, CrateStore}; use rustc::middle::def::Def; use rustc::middle::def_id::{DefId, DefIndex}; -use rustc::middle::subst::{self, ParamSpace, VecPerParamSpace}; -use rustc::middle::ty; +use rustc::ty::subst::{self, ParamSpace, VecPerParamSpace}; +use rustc::ty; use rustc::middle::stability; use rustc_front::hir; @@ -831,7 +831,7 @@ impl Clean for hir::WherePredicate { impl<'a> Clean for ty::Predicate<'a> { fn clean(&self, cx: &DocContext) -> WherePredicate { - use rustc::middle::ty::Predicate; + use rustc::ty::Predicate; match *self { Predicate::Trait(ref pred) => pred.clean(cx), diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs index 716b88d5534..e6a4d882c04 100644 --- a/src/librustdoc/clean/simplify.rs +++ b/src/librustdoc/clean/simplify.rs @@ -11,7 +11,7 @@ //! Simplification of where clauses and parameter bounds into a prettier and //! more canonical form. //! -//! Currently all cross-crate-inlined function use `middle::ty` to reconstruct +//! Currently all cross-crate-inlined function use `rustc::ty` to reconstruct //! the AST (e.g. see all of `clean::inline`), but this is not always a //! non-lossy transformation. The current format of storage for where clauses //! for functions and such is simply a list of predicates. One example of this @@ -30,7 +30,7 @@ use std::mem; use std::collections::HashMap; use rustc::middle::def_id::DefId; -use rustc::middle::subst; +use rustc::ty::subst; use clean::PathParameters as PP; use clean::WherePredicate as WP; diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index c30fd39616c..15a10a84e43 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -15,7 +15,7 @@ use rustc::dep_graph::DepGraph; use rustc::session::{self, config}; use rustc::middle::def_id::DefId; use rustc::middle::privacy::AccessLevels; -use rustc::middle::ty::{self, TyCtxt}; +use rustc::ty::{self, TyCtxt}; use rustc::front::map as hir_map; use rustc::lint; use rustc_trans::back::link; diff --git a/src/test/auxiliary/dummy_mir_pass.rs b/src/test/auxiliary/dummy_mir_pass.rs index fdfbc98b007..3e1b46522a9 100644 --- a/src/test/auxiliary/dummy_mir_pass.rs +++ b/src/test/auxiliary/dummy_mir_pass.rs @@ -22,7 +22,7 @@ extern crate syntax; use rustc::mir::transform::{self, MirPass}; use rustc::mir::repr::{Mir, Literal}; use rustc::mir::visit::MutVisitor; -use rustc::middle::ty; +use rustc::ty; use rustc::middle::const_eval::ConstVal; use rustc_const_eval::ConstInt; use rustc_plugin::Registry; diff --git a/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs b/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs index 865784c2f1e..0c4aae8cfad 100644 --- a/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs +++ b/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs @@ -10,7 +10,7 @@ // Test for a subtle failure computing kinds of cyclic types, in which // temporary kinds wound up being stored in a cache and used later. -// See middle::ty::type_contents() for more information. +// See rustc::ty::type_contents() for more information. struct List { key: isize, next: Option> } diff --git a/src/test/run-make/execution-engine/test.rs b/src/test/run-make/execution-engine/test.rs index 4ff531d4755..7454bbfb531 100644 --- a/src/test/run-make/execution-engine/test.rs +++ b/src/test/run-make/execution-engine/test.rs @@ -30,7 +30,7 @@ use rustc::dep_graph::DepGraph; use rustc::front::map as ast_map; use rustc::llvm; use rustc::middle::cstore::{CrateStore, LinkagePreference}; -use rustc::middle::ty; +use rustc::ty; use rustc::session::config::{self, basic_options, build_configuration, Input, Options}; use rustc::session::build_session; use rustc_driver::{driver, abort_on_err};