From b9a231127839ebc01bdfe1ce402553b821e4c004 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 22 Mar 2016 16:21:46 +0200 Subject: [PATCH 1/4] rustc: move middle::subst into middle::ty. --- src/librustc/lib.rs | 1 - src/librustc/middle/const_eval.rs | 4 ++-- src/librustc/middle/cstore.rs | 2 +- src/librustc/middle/def.rs | 2 +- src/librustc/middle/infer/error_reporting.rs | 2 +- src/librustc/middle/infer/mod.rs | 6 +++--- src/librustc/middle/intrinsicck.rs | 2 +- src/librustc/middle/liveness.rs | 2 +- src/librustc/middle/resolve_lifetime.rs | 2 +- src/librustc/middle/traits/coherence.rs | 2 +- src/librustc/middle/traits/mod.rs | 2 +- src/librustc/middle/traits/object_safety.rs | 2 +- src/librustc/middle/traits/project.rs | 2 +- src/librustc/middle/traits/select.rs | 2 +- src/librustc/middle/traits/specialize/mod.rs | 2 +- src/librustc/middle/traits/util.rs | 2 +- src/librustc/middle/ty/context.rs | 2 +- src/librustc/middle/ty/error.rs | 2 +- src/librustc/middle/ty/flags.rs | 2 +- src/librustc/middle/ty/fold.rs | 2 +- src/librustc/middle/ty/mod.rs | 3 ++- src/librustc/middle/ty/relate.rs | 2 +- src/librustc/middle/ty/structural_impls.rs | 2 +- src/librustc/middle/ty/sty.rs | 2 +- src/librustc/middle/{ => ty}/subst.rs | 0 src/librustc/middle/ty/util.rs | 2 +- src/librustc/middle/ty/wf.rs | 2 +- src/librustc/mir/repr.rs | 2 +- src/librustc/mir/tcx.rs | 2 +- src/librustc/util/ppaux.rs | 2 +- src/librustc_driver/test.rs | 4 ++-- src/librustc_lint/builtin.rs | 2 +- src/librustc_lint/types.rs | 2 +- src/librustc_metadata/astencode.rs | 2 +- src/librustc_metadata/decoder.rs | 2 +- src/librustc_metadata/encoder.rs | 2 +- src/librustc_metadata/tls_context.rs | 2 +- src/librustc_metadata/tydecode.rs | 4 ++-- src/librustc_metadata/tyencode.rs | 4 ++-- src/librustc_mir/build/scope.rs | 2 +- src/librustc_mir/hair/cx/mod.rs | 2 +- src/librustc_mir/hair/mod.rs | 2 +- src/librustc_resolve/lib.rs | 2 +- src/librustc_trans/trans/_match.rs | 2 +- src/librustc_trans/trans/adt.rs | 2 +- src/librustc_trans/trans/base.rs | 2 +- src/librustc_trans/trans/callee.rs | 4 ++-- src/librustc_trans/trans/collector.rs | 2 +- src/librustc_trans/trans/common.rs | 2 +- src/librustc_trans/trans/consts.rs | 2 +- src/librustc_trans/trans/context.rs | 2 +- src/librustc_trans/trans/controlflow.rs | 2 +- src/librustc_trans/trans/debuginfo/metadata.rs | 2 +- src/librustc_trans/trans/debuginfo/mod.rs | 2 +- src/librustc_trans/trans/debuginfo/type_names.rs | 2 +- src/librustc_trans/trans/expr.rs | 2 +- src/librustc_trans/trans/glue.rs | 2 +- src/librustc_trans/trans/inline.rs | 2 +- src/librustc_trans/trans/intrinsic.rs | 6 +++--- src/librustc_trans/trans/meth.rs | 4 ++-- src/librustc_trans/trans/monomorphize.rs | 4 ++-- src/librustc_trans/trans/type_of.rs | 2 +- src/librustc_typeck/astconv.rs | 2 +- src/librustc_typeck/check/_match.rs | 2 +- src/librustc_typeck/check/closure.rs | 2 +- src/librustc_typeck/check/compare_method.rs | 2 +- src/librustc_typeck/check/dropck.rs | 2 +- src/librustc_typeck/check/intrinsic.rs | 2 +- src/librustc_typeck/check/method/confirm.rs | 2 +- src/librustc_typeck/check/method/mod.rs | 2 +- src/librustc_typeck/check/method/probe.rs | 4 ++-- src/librustc_typeck/check/method/suggest.rs | 2 +- src/librustc_typeck/check/mod.rs | 2 +- src/librustc_typeck/check/regionck.rs | 2 +- src/librustc_typeck/check/wfcheck.rs | 2 +- src/librustc_typeck/coherence/mod.rs | 2 +- src/librustc_typeck/collect.rs | 2 +- src/librustc_typeck/constrained_type_params.rs | 2 +- src/librustc_typeck/lib.rs | 2 +- src/librustc_typeck/variance/constraints.rs | 4 ++-- src/librustc_typeck/variance/solve.rs | 2 +- src/librustc_typeck/variance/terms.rs | 2 +- src/librustdoc/clean/inline.rs | 2 +- src/librustdoc/clean/mod.rs | 2 +- src/librustdoc/clean/simplify.rs | 2 +- 85 files changed, 97 insertions(+), 97 deletions(-) rename src/librustc/middle/{ => ty}/subst.rs (100%) diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index d8d0079b3e398..37b6ea7872aad 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -113,7 +113,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; diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index a8c2a73e72f51..5cb5595e9e8ed 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -17,11 +17,11 @@ use self::EvalHint::*; use front::map as ast_map; use front::map::blocks::FnLikeNode; use middle::cstore::{self, CrateStore, InlinedItem}; -use middle::{infer, subst, traits}; +use middle::{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::{self, subst, Ty, TyCtxt}; use middle::ty::util::IntTypeExt; use middle::traits::ProjectionMode; use middle::astconv_util::ast_ty_to_prim_ty; diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs index f85d87413843e..9a3550b65aa2d 100644 --- a/src/librustc/middle/cstore.rs +++ b/src/librustc/middle/cstore.rs @@ -455,7 +455,7 @@ pub mod tls { use std::cell::Cell; use std::mem; use middle::ty::{self, Ty, TyCtxt}; - use middle::subst::Substs; + use middle::ty::subst::Substs; use middle::def_id::DefId; pub trait EncodingContext<'tcx> { diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index 6d4799749b93a..f832a871c8b1b 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 middle::ty::subst::ParamSpace; use util::nodemap::NodeMap; use syntax::ast; use rustc_front::hir; diff --git a/src/librustc/middle/infer/error_reporting.rs b/src/librustc/middle/infer/error_reporting.rs index 089eae89d0492..7a1da77453147 100644 --- a/src/librustc/middle/infer/error_reporting.rs +++ b/src/librustc/middle/infer/error_reporting.rs @@ -82,7 +82,7 @@ use middle::def::Def; use middle::def_id::DefId; use middle::infer::{self, TypeOrigin}; use middle::region; -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; use middle::ty::{Region, ReFree}; use middle::ty::error::TypeError; diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index 645e5323ef4ae..ea11ade1d16dd 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -24,9 +24,9 @@ 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::ty::subst; +use middle::ty::subst::Substs; +use middle::ty::subst::Subst; use middle::traits::{self, ProjectionMode}; use middle::ty::adjustment; use middle::ty::{TyVid, IntVid, FloatVid}; diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index 233e55cdbb5dd..e3da34acb4b43 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -11,7 +11,7 @@ use dep_graph::DepNode; use middle::def::Def; use middle::def_id::DefId; -use middle::subst::{Subst, Substs, EnumeratedItems}; +use middle::ty::subst::{Subst, Substs, EnumeratedItems}; use middle::ty::{TransmuteRestriction, TyCtxt}; use middle::ty::{self, Ty, TypeFoldable}; diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 9507c379b4fe1..ee39a4fc7df6e 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -115,7 +115,7 @@ use middle::pat_util; use middle::ty::{self, TyCtxt, ParameterEnvironment}; use middle::traits::{self, ProjectionMode}; use middle::infer; -use middle::subst::Subst; +use middle::ty::subst::Subst; use lint; use util::nodemap::NodeMap; diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index a80b130e5be5f..8d3a80854b467 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -23,7 +23,7 @@ use front::map::Map; use session::Session; use middle::def::{Def, DefMap}; use middle::region; -use middle::subst; +use middle::ty::subst; use middle::ty; use std::fmt; use std::mem::replace; diff --git a/src/librustc/middle/traits/coherence.rs b/src/librustc/middle/traits/coherence.rs index 64d1c992cbf1d..547cb71f234f0 100644 --- a/src/librustc/middle/traits/coherence.rs +++ b/src/librustc/middle/traits/coherence.rs @@ -14,7 +14,7 @@ use super::{SelectionContext, Obligation, ObligationCause}; use middle::cstore::LOCAL_CRATE; use middle::def_id::DefId; -use middle::subst::TypeSpace; +use middle::ty::subst::TypeSpace; use middle::ty::{self, Ty, TyCtxt}; use middle::infer::{self, InferCtxt, TypeOrigin}; use syntax::codemap::DUMMY_SP; diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/middle/traits/mod.rs index 5f66e9e6344ad..9404731859961 100644 --- a/src/librustc/middle/traits/mod.rs +++ b/src/librustc/middle/traits/mod.rs @@ -17,7 +17,7 @@ pub use self::ObligationCauseCode::*; use middle::def_id::DefId; use middle::free_region::FreeRegionMap; -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty, TypeFoldable}; use middle::infer::{self, fixup_err_to_string, InferCtxt}; diff --git a/src/librustc/middle/traits/object_safety.rs b/src/librustc/middle/traits/object_safety.rs index 4a0da521eef30..8777b9eb00cfd 100644 --- a/src/librustc/middle/traits/object_safety.rs +++ b/src/librustc/middle/traits/object_safety.rs @@ -21,7 +21,7 @@ use super::supertraits; use super::elaborate_predicates; use middle::def_id::DefId; -use middle::subst::{self, SelfSpace, TypeSpace}; +use middle::ty::subst::{self, SelfSpace, TypeSpace}; use middle::traits; use middle::ty::{self, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; use std::rc::Rc; diff --git a/src/librustc/middle/traits/project.rs b/src/librustc/middle/traits/project.rs index e86f3ed01a49d..bd075a5dc88db 100644 --- a/src/librustc/middle/traits/project.rs +++ b/src/librustc/middle/traits/project.rs @@ -25,7 +25,7 @@ use super::util; use middle::def_id::DefId; use middle::infer::{self, TypeOrigin}; -use middle::subst::Subst; +use middle::ty::subst::Subst; use middle::ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt}; use middle::ty::fold::{TypeFoldable, TypeFolder}; use syntax::parse::token; diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 3eaf123e5be58..050468809a5ac 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -39,7 +39,7 @@ 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::subst::{Subst, Substs, TypeSpace}; use middle::ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable}; use middle::traits; use middle::ty::fast_reject; diff --git a/src/librustc/middle/traits/specialize/mod.rs b/src/librustc/middle/traits/specialize/mod.rs index 92478f2874e1e..088099d87b158 100644 --- a/src/librustc/middle/traits/specialize/mod.rs +++ b/src/librustc/middle/traits/specialize/mod.rs @@ -24,7 +24,7 @@ use middle::cstore::CrateStore; use middle::def_id::DefId; use middle::infer::{self, InferCtxt, TypeOrigin}; use middle::region; -use middle::subst::{Subst, Substs}; +use middle::ty::subst::{Subst, Substs}; use middle::traits::{self, ProjectionMode, ObligationCause, Normalized}; use middle::ty::{self, TyCtxt}; use syntax::codemap::DUMMY_SP; diff --git a/src/librustc/middle/traits/util.rs b/src/librustc/middle/traits/util.rs index 9f984bc1fc63a..f9a1b09a93d2c 100644 --- a/src/librustc/middle/traits/util.rs +++ b/src/librustc/middle/traits/util.rs @@ -10,7 +10,7 @@ use middle::def_id::DefId; use middle::infer::InferCtxt; -use middle::subst::{Subst, Substs}; +use middle::ty::subst::{Subst, Substs}; use middle::ty::{self, Ty, TyCtxt, ToPredicate, ToPolyTraitRef}; use syntax::codemap::Span; use util::common::ErrorReported; diff --git a/src/librustc/middle/ty/context.rs b/src/librustc/middle/ty/context.rs index 03c13115aea62..aa0ac62ac5719 100644 --- a/src/librustc/middle/ty/context.rs +++ b/src/librustc/middle/ty/context.rs @@ -22,7 +22,7 @@ use middle::free_region::FreeRegionMap; use middle::region::RegionMaps; use middle::resolve_lifetime; use middle::stability; -use middle::subst::{self, Subst, Substs}; +use middle::ty::subst::{self, Subst, Substs}; use middle::traits; use middle::ty::{self, TraitRef, Ty, TypeAndMut}; use middle::ty::{TyS, TypeVariants}; diff --git a/src/librustc/middle/ty/error.rs b/src/librustc/middle/ty/error.rs index 1033af5f331a7..8e1ace57e42ad 100644 --- a/src/librustc/middle/ty/error.rs +++ b/src/librustc/middle/ty/error.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::def_id::DefId; -use middle::subst; +use middle::ty::subst; use middle::infer::type_variable; use middle::ty::{self, BoundRegion, Region, Ty, TyCtxt}; diff --git a/src/librustc/middle/ty/flags.rs b/src/librustc/middle/ty/flags.rs index c874e9b7ca52d..12b2426150797 100644 --- a/src/librustc/middle/ty/flags.rs +++ b/src/librustc/middle/ty/flags.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty, TypeFlags, TypeFoldable}; pub struct FlagComputation { diff --git a/src/librustc/middle/ty/fold.rs b/src/librustc/middle/ty/fold.rs index f754e5c5a0a7d..2e8782a72f691 100644 --- a/src/librustc/middle/ty/fold.rs +++ b/src/librustc/middle/ty/fold.rs @@ -40,7 +40,7 @@ //! and does not need to visit anything else. use middle::region; -use middle::subst; +use middle::ty::subst; use middle::ty::adjustment; use middle::ty::{self, Binder, Ty, TyCtxt, TypeFlags}; diff --git a/src/librustc/middle/ty/mod.rs b/src/librustc/middle/ty/mod.rs index 050024d0e94ea..c5f10c332fc0a 100644 --- a/src/librustc/middle/ty/mod.rs +++ b/src/librustc/middle/ty/mod.rs @@ -27,10 +27,10 @@ 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::subst::{Subst, Substs, VecPerParamSpace}; use middle::ty::walk::TypeWalker; use util::common::MemoizationMap; use util::nodemap::{NodeMap, NodeSet}; @@ -90,6 +90,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/relate.rs b/src/librustc/middle/ty/relate.rs index 563ff346a6440..d648c2c588476 100644 --- a/src/librustc/middle/ty/relate.rs +++ b/src/librustc/middle/ty/relate.rs @@ -14,7 +14,7 @@ //! type equality, etc. use middle::def_id::DefId; -use middle::subst::{ParamSpace, Substs}; +use middle::ty::subst::{ParamSpace, Substs}; use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; use middle::ty::error::{ExpectedFound, TypeError}; use std::rc::Rc; diff --git a/src/librustc/middle/ty/structural_impls.rs b/src/librustc/middle/ty/structural_impls.rs index 0358fa2f12455..23ec75b18e82c 100644 --- a/src/librustc/middle/ty/structural_impls.rs +++ b/src/librustc/middle/ty/structural_impls.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::subst::{self, VecPerParamSpace}; +use middle::ty::subst::{self, VecPerParamSpace}; use middle::traits; use middle::ty::{self, Lift, TraitRef, Ty, TyCtxt}; use middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; diff --git a/src/librustc/middle/ty/sty.rs b/src/librustc/middle/ty/sty.rs index 7a17b24df5e9d..d8f0dd2903196 100644 --- a/src/librustc/middle/ty/sty.rs +++ b/src/librustc/middle/ty/sty.rs @@ -13,7 +13,7 @@ use middle::cstore; use middle::def_id::DefId; use middle::region; -use middle::subst::{self, Substs}; +use middle::ty::subst::{self, Substs}; use middle::traits; use middle::ty::{self, AdtDef, ToPredicate, TypeFlags, Ty, TyCtxt, TyS, TypeFoldable}; use util::common::ErrorReported; diff --git a/src/librustc/middle/subst.rs b/src/librustc/middle/ty/subst.rs similarity index 100% rename from src/librustc/middle/subst.rs rename to src/librustc/middle/ty/subst.rs diff --git a/src/librustc/middle/ty/util.rs b/src/librustc/middle/ty/util.rs index 6a91592dbd52a..f6c4390b83c96 100644 --- a/src/librustc/middle/ty/util.rs +++ b/src/librustc/middle/ty/util.rs @@ -14,7 +14,7 @@ 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::ty::subst; use middle::infer; use middle::pat_util; use middle::traits::{self, ProjectionMode}; diff --git a/src/librustc/middle/ty/wf.rs b/src/librustc/middle/ty/wf.rs index 5f81d27a1f688..1becdb14fa534 100644 --- a/src/librustc/middle/ty/wf.rs +++ b/src/librustc/middle/ty/wf.rs @@ -11,7 +11,7 @@ use middle::def_id::DefId; use middle::infer::InferCtxt; use middle::ty::outlives::{self, Component}; -use middle::subst::Substs; +use middle::ty::subst::Substs; use middle::traits; use middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; use std::iter::once; diff --git a/src/librustc/mir/repr.rs b/src/librustc/mir/repr.rs index 47d923cbce359..20cf6d929ca7c 100644 --- a/src/librustc/mir/repr.rs +++ b/src/librustc/mir/repr.rs @@ -12,7 +12,7 @@ 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::subst::Substs; use middle::ty::{self, AdtDef, ClosureSubsts, FnOutput, Region, Ty}; use util::ppaux; use rustc_back::slice; diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index c8a2bc440ce1d..0c9e00a6c5ec4 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -14,7 +14,7 @@ */ use mir::repr::*; -use middle::subst::{Subst, Substs}; +use middle::ty::subst::{Subst, Substs}; use middle::ty::{self, AdtDef, Ty, TyCtxt}; use middle::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use rustc_front::hir; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 6e7f49516e8fa..f67346fe1f940 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -10,7 +10,7 @@ use middle::def_id::DefId; -use middle::subst::{self, Subst}; +use middle::ty::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}; diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index 1a5e7cb54f2e3..abbea81897173 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -20,8 +20,8 @@ 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::ty::subst; +use rustc_typeck::middle::ty::subst::Subst; use rustc_typeck::middle::traits::ProjectionMode; use rustc_typeck::middle::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc_typeck::middle::ty::relate::TypeRelation; diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 2ccb905b6ecdf..66e19cf29bf9e 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -32,7 +32,7 @@ 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::subst::Substs; use middle::ty::{self, Ty, TyCtxt}; use middle::ty::adjustment; use middle::traits::ProjectionMode; diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 1a84afab86bfc..3dfd265c5a020 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -12,7 +12,7 @@ use middle::{infer}; use middle::def_id::DefId; -use middle::subst::Substs; +use middle::ty::subst::Substs; use middle::ty::{self, Ty, TyCtxt}; use middle::const_eval::{eval_const_expr_partial, ConstVal}; use middle::const_eval::EvalHint::ExprTypeChecked; diff --git a/src/librustc_metadata/astencode.rs b/src/librustc_metadata/astencode.rs index 5c5574c3a8300..1cf6c9b53e2c5 100644 --- a/src/librustc_metadata/astencode.rs +++ b/src/librustc_metadata/astencode.rs @@ -33,7 +33,7 @@ use middle::const_qualif::ConstQualif; use middle::def::{self, Def}; use middle::def_id::DefId; use middle::region; -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty, TyCtxt}; use syntax::{ast, ast_util, codemap}; diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 0c736feeefeee..f88552707437b 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -32,7 +32,7 @@ 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::subst; use middle::ty::{ImplContainer, TraitContainer}; use middle::ty::{self, Ty, TyCtxt, TypeFoldable, VariantKind}; diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index e677ea962f9cf..dc338048a83af 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -25,7 +25,7 @@ use middle::def; use middle::def_id::{CRATE_DEF_INDEX, DefId}; use middle::dependency_format::Linkage; use middle::stability; -use middle::subst; +use middle::ty::subst; use middle::traits::specialization_graph; use middle::ty::{self, Ty, TyCtxt}; use middle::ty::util::IntTypeExt; diff --git a/src/librustc_metadata/tls_context.rs b/src/librustc_metadata/tls_context.rs index f90abd9e1d961..2ba3e351c50aa 100644 --- a/src/librustc_metadata/tls_context.rs +++ b/src/librustc_metadata/tls_context.rs @@ -15,7 +15,7 @@ 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::subst::Substs; use rustc::middle::ty::{self, TyCtxt}; use decoder::{self, Cmd}; diff --git a/src/librustc_metadata/tydecode.rs b/src/librustc_metadata/tydecode.rs index cd9c2e828bdef..8c88a63a161f4 100644 --- a/src/librustc_metadata/tydecode.rs +++ b/src/librustc_metadata/tydecode.rs @@ -20,8 +20,8 @@ use rustc_front::hir; use middle::def_id::{DefId, DefIndex}; use middle::region; -use middle::subst; -use middle::subst::VecPerParamSpace; +use middle::ty::subst; +use middle::ty::subst::VecPerParamSpace; use middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; use rbml; diff --git a/src/librustc_metadata/tyencode.rs b/src/librustc_metadata/tyencode.rs index 4718732c8a037..5086977ea0637 100644 --- a/src/librustc_metadata/tyencode.rs +++ b/src/librustc_metadata/tyencode.rs @@ -19,8 +19,8 @@ use std::io::prelude::*; use middle::def_id::DefId; use middle::region; -use middle::subst; -use middle::subst::VecPerParamSpace; +use middle::ty::subst; +use middle::ty::subst::VecPerParamSpace; use middle::ty::ParamTy; use middle::ty::{self, Ty, TyCtxt}; use rustc::util::nodemap::FnvHashMap; diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs index f5f6f409eaba4..033e1361d4a8c 100644 --- a/src/librustc_mir/build/scope.rs +++ b/src/librustc_mir/build/scope.rs @@ -89,7 +89,7 @@ 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::subst::{Substs, Subst, VecPerParamSpace}; use rustc::middle::ty::{self, Ty, TyCtxt}; use rustc::mir::repr::*; use syntax::codemap::{Span, DUMMY_SP}; diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index b97bfaf5aef68..d603979906dda 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -21,7 +21,7 @@ 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::subst::{Subst, Substs}; use rustc::middle::ty::{self, Ty, TyCtxt}; use syntax::codemap::Span; use syntax::parse::token; diff --git a/src/librustc_mir/hair/mod.rs b/src/librustc_mir/hair/mod.rs index 78c438df6f87a..3eca7f0a8772c 100644 --- a/src/librustc_mir/hair/mod.rs +++ b/src/librustc_mir/hair/mod.rs @@ -19,7 +19,7 @@ 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::subst::Substs; use rustc::middle::ty::{self, AdtDef, ClosureSubsts, Region, Ty}; use rustc_front::hir; use syntax::ast; diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index af8c9d8168742..62443efbe2ab9 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -55,7 +55,7 @@ use rustc::middle::cstore::{CrateStore, DefLike, DlDef}; 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::subst::{ParamSpace, FnSpace, TypeSpace}; use rustc::middle::ty::{Freevar, FreevarMap, TraitMap, GlobMap}; use rustc::util::nodemap::{NodeMap, FnvHashMap}; diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index 8aea2f1ec4f4a..561fd022ecef5 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -200,7 +200,7 @@ 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 middle::ty::subst::Substs; use trans::adt; use trans::base::*; use trans::build::{AddCase, And, Br, CondBr, GEPi, InBoundsGEP, Load, PointerCast}; diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index db0fa2a64bde6..e94c4ebe3b56b 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -48,7 +48,7 @@ use std; use std::rc::Rc; use llvm::{ValueRef, True, IntEQ, IntNE}; -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty, TyCtxt}; use syntax::ast; use syntax::attr; diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 1d8daf9d86b4a..9892cf67e8afe 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -41,7 +41,7 @@ use middle::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::ty::subst::{self, Substs}; use middle::traits; use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; use middle::ty::adjustment::CustomCoerceUnsized; diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index 1013c5d64b609..ff806ac5125ee 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -23,8 +23,8 @@ 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::ty::subst; +use middle::ty::subst::{Substs}; use middle::traits; use rustc::front::map as hir_map; use trans::abi::{Abi, FnType}; diff --git a/src/librustc_trans/trans/collector.rs b/src/librustc_trans/trans/collector.rs index ab8f7d6bec3d5..fbd58fbea085d 100644 --- a/src/librustc_trans/trans/collector.rs +++ b/src/librustc_trans/trans/collector.rs @@ -195,7 +195,7 @@ 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::subst::{self, Substs, Subst}; use rustc::middle::ty::{self, Ty, TypeFoldable}; use rustc::middle::ty::adjustment::CustomCoerceUnsized; use rustc::mir::repr as mir; diff --git a/src/librustc_trans/trans/common.rs b/src/librustc_trans/trans/common.rs index db06b2352fd35..eb443a3b0b977 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/trans/common.rs @@ -21,7 +21,7 @@ use middle::def::Def; use middle::def_id::DefId; use middle::infer; use middle::lang_items::LangItem; -use middle::subst::Substs; +use middle::ty::subst::Substs; use trans::abi::{Abi, FnType}; use trans::base; use trans::build; diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/trans/consts.rs index 7e6b24969100b..cb4092ffb9eba 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -32,7 +32,7 @@ use trans::type_::Type; use trans::type_of; use trans::value::Value; use trans::Disr; -use middle::subst::Substs; +use middle::ty::subst::Substs; use middle::ty::adjustment::{AdjustDerefRef, AdjustReifyFnPointer}; use middle::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer}; use middle::ty::{self, Ty, TyCtxt}; diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/trans/context.rs index 046e05dd0710a..db2b5b86a7e0b 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -28,7 +28,7 @@ use trans::mir::CachedMir; use trans::monomorphize::Instance; use trans::collector::{TransItem, TransItemState}; use trans::type_::{Type, TypeNames}; -use middle::subst::{Substs, VecPerParamSpace}; +use middle::ty::subst::{Substs, VecPerParamSpace}; use middle::ty::{self, Ty, TyCtxt}; use session::config::NoDebugInfo; use session::Session; diff --git a/src/librustc_trans/trans/controlflow.rs b/src/librustc_trans/trans/controlflow.rs index 91454df156655..65f5ab1f22818 100644 --- a/src/librustc_trans/trans/controlflow.rs +++ b/src/librustc_trans/trans/controlflow.rs @@ -11,7 +11,7 @@ use llvm::ValueRef; use middle::def::Def; use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem}; -use middle::subst::Substs; +use middle::ty::subst::Substs; use trans::base::*; use trans::basic_block::BasicBlock; use trans::build::*; diff --git a/src/librustc_trans/trans/debuginfo/metadata.rs b/src/librustc_trans/trans/debuginfo/metadata.rs index e22d42e9d28da..a654a3f37c8da 100644 --- a/src/librustc_trans/trans/debuginfo/metadata.rs +++ b/src/librustc_trans/trans/debuginfo/metadata.rs @@ -26,7 +26,7 @@ use llvm::debuginfo::{DIType, DIFile, DIScope, DIDescriptor, DICompositeType}; use middle::def_id::DefId; use middle::infer; use middle::pat_util; -use middle::subst; +use middle::ty::subst; use rustc::front::map as hir_map; use rustc_front::hir::{self, PatKind}; use trans::{type_of, adt, machine, monomorphize}; diff --git a/src/librustc_trans/trans/debuginfo/mod.rs b/src/librustc_trans/trans/debuginfo/mod.rs index 40eb29ed25050..dbba03cf4551f 100644 --- a/src/librustc_trans/trans/debuginfo/mod.rs +++ b/src/librustc_trans/trans/debuginfo/mod.rs @@ -28,7 +28,7 @@ use llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilderRef, DISubprogram, DIArr DIDescriptor, FlagPrototyped}; use middle::def_id::DefId; use middle::infer::normalize_associated_type; -use middle::subst::{self, Substs}; +use middle::ty::subst::{self, Substs}; use rustc_front; use rustc_front::hir; diff --git a/src/librustc_trans/trans/debuginfo/type_names.rs b/src/librustc_trans/trans/debuginfo/type_names.rs index b71b7789affe2..a051966795d55 100644 --- a/src/librustc_trans/trans/debuginfo/type_names.rs +++ b/src/librustc_trans/trans/debuginfo/type_names.rs @@ -15,7 +15,7 @@ use super::namespace::crate_root_namespace; use trans::common::CrateContext; use middle::def_id::DefId; use middle::infer; -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty}; use rustc_front::hir; diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index fe98fa290211c..8b7527fd7de64 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -54,7 +54,7 @@ use self::lazy_binop_ty::*; use llvm::{self, ValueRef, TypeKind}; use middle::const_qualif::ConstQualif; use middle::def::Def; -use middle::subst::Substs; +use middle::ty::subst::Substs; use trans::{_match, abi, adt, asm, base, closure, consts, controlflow}; use trans::base::*; use trans::build::*; diff --git a/src/librustc_trans/trans/glue.rs b/src/librustc_trans/trans/glue.rs index de4b1ba858a6c..02a14715ab28b 100644 --- a/src/librustc_trans/trans/glue.rs +++ b/src/librustc_trans/trans/glue.rs @@ -18,7 +18,7 @@ use back::link; use llvm; use llvm::{ValueRef, get_param}; use middle::lang_items::ExchangeFreeFnLangItem; -use middle::subst::{Substs}; +use middle::ty::subst::{Substs}; use middle::traits; use middle::ty::{self, Ty, TyCtxt}; use trans::abi::{Abi, FnType}; diff --git a/src/librustc_trans/trans/inline.rs b/src/librustc_trans/trans/inline.rs index 530b99cba920c..87b4a572884ec 100644 --- a/src/librustc_trans/trans/inline.rs +++ b/src/librustc_trans/trans/inline.rs @@ -11,7 +11,7 @@ use llvm::{AvailableExternallyLinkage, InternalLinkage, SetLinkage}; use middle::cstore::{CrateStore, FoundAst, InlinedItem}; use middle::def_id::DefId; -use middle::subst::Substs; +use middle::ty::subst::Substs; use trans::base::{push_ctxt, trans_item, trans_fn}; use trans::callee::Callee; use trans::common::*; diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index 9bc07c6cd8626..d3b84fbac1a9b 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -16,8 +16,8 @@ use libc; use llvm; use llvm::{ValueRef, TypeKind}; use middle::infer; -use middle::subst; -use middle::subst::FnSpace; +use middle::ty::subst; +use middle::ty::subst::FnSpace; use trans::abi::{Abi, FnType}; use trans::adt; use trans::attributes; @@ -38,7 +38,7 @@ use trans::machine; use trans::type_::Type; use middle::ty::{self, Ty, TypeFoldable}; use trans::Disr; -use middle::subst::Substs; +use middle::ty::subst::Substs; use rustc::dep_graph::DepNode; use rustc_front::hir; use syntax::ast; diff --git a/src/librustc_trans/trans/meth.rs b/src/librustc_trans/trans/meth.rs index ae619ceb30b01..d86f0c4e6dff3 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/trans/meth.rs @@ -15,8 +15,8 @@ use back::link; use llvm::{ValueRef, get_params}; use middle::def_id::DefId; use middle::infer; -use middle::subst::{FnSpace, Subst, Substs}; -use middle::subst; +use middle::ty::subst::{FnSpace, Subst, Substs}; +use middle::ty::subst; use middle::traits::{self, ProjectionMode}; use trans::abi::FnType; use trans::base::*; diff --git a/src/librustc_trans/trans/monomorphize.rs b/src/librustc_trans/trans/monomorphize.rs index 63fb8c5fb5e1c..986d05af92f2c 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/trans/monomorphize.rs @@ -13,8 +13,8 @@ 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::subst; +use middle::ty::subst::{Subst, Substs}; use middle::ty::fold::{TypeFolder, TypeFoldable}; use trans::attributes; use trans::base::{push_ctxt}; diff --git a/src/librustc_trans/trans/type_of.rs b/src/librustc_trans/trans/type_of.rs index 7d5218d84dafe..e81039908c173 100644 --- a/src/librustc_trans/trans/type_of.rs +++ b/src/librustc_trans/trans/type_of.rs @@ -12,7 +12,7 @@ use middle::def_id::DefId; use middle::infer; -use middle::subst; +use middle::ty::subst; use trans::abi::FnType; use trans::adt; use trans::common::*; diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 159ff90b50955..3b3d2cbad10cc 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -54,7 +54,7 @@ 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::ty::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; diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 305970db9e72e..947488bde71dd 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -12,7 +12,7 @@ use middle::def::{self, Def}; use middle::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::subst::Substs; use middle::ty::{self, Ty, TypeFoldable, LvaluePreference}; use check::{check_expr, check_expr_has_type, check_expr_with_expectation}; use check::{demand, FnCtxt, Expectation}; diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index a4fb2e381459e..54b2c8c59234e 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -13,7 +13,7 @@ use super::{check_fn, Expectation, FnCtxt}; use astconv; -use middle::subst; +use middle::ty::subst; use middle::ty::{self, ToPolyTraitRef, Ty}; use std::cmp; use syntax::abi::Abi; diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 3e59f0ba73a81..eee3fddcaea3d 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -12,7 +12,7 @@ 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 middle::ty::subst::{self, Subst, Substs, VecPerParamSpace}; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/dropck.rs b/src/librustc_typeck/check/dropck.rs index 7dd5db831fd75..fd5d06ea9d19e 100644 --- a/src/librustc_typeck/check/dropck.rs +++ b/src/librustc_typeck/check/dropck.rs @@ -14,7 +14,7 @@ use middle::def_id::DefId; use middle::free_region::FreeRegionMap; use middle::infer; use middle::region; -use middle::subst::{self, Subst}; +use middle::ty::subst::{self, Subst}; use middle::ty::{self, Ty, TyCtxt}; use middle::traits::{self, ProjectionMode}; use util::nodemap::FnvHashSet; diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index 2cd166ebe7ebe..9440be50e2106 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -13,7 +13,7 @@ use astconv::AstConv; use intrinsics; -use middle::subst::{self, Substs}; +use middle::ty::subst::{self, Substs}; use middle::ty::FnSig; use middle::ty::{self, Ty, TyCtxt}; use middle::ty::fold::TypeFolder; diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index aa4e1d0b52908..b8c1d43b7c475 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -13,7 +13,7 @@ use super::probe; use check::{self, FnCtxt, callee, demand}; use check::UnresolvedTypeAction; use middle::def_id::DefId; -use middle::subst::{self}; +use middle::ty::subst::{self}; use middle::traits; use middle::ty::{self, NoPreference, PreferMutLvalue, Ty, TyCtxt}; use middle::ty::adjustment::{AdjustDerefRef, AutoDerefRef, AutoPtr}; diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 7f982c466a704..6648236f33ae0 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -14,7 +14,7 @@ use astconv::AstConv; use check::FnCtxt; use middle::def::Def; use middle::def_id::DefId; -use middle::subst; +use middle::ty::subst; use middle::traits; use middle::ty::{self, TyCtxt, ToPredicate, ToPolyTraitRef, TraitRef, TypeFoldable}; use middle::ty::adjustment::{AdjustDerefRef, AutoDerefRef, AutoPtr}; diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 5f7f9703b1059..6be822aebcadf 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -16,8 +16,8 @@ use super::suggest; use check; use check::{FnCtxt, UnresolvedTypeAction}; use middle::def_id::DefId; -use middle::subst; -use middle::subst::Subst; +use middle::ty::subst; +use middle::ty::subst::Subst; use middle::traits; use middle::ty::{self, NoPreference, Ty, TyCtxt, ToPolyTraitRef, TraitRef, TypeFoldable}; use middle::infer; diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 44724ca26b164..b940c073a7fec 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -21,7 +21,7 @@ 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::ty::subst::Substs; use middle::traits::{Obligation, SelectionContext}; use util::nodemap::{FnvHashSet}; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 6eb663e604791..8d025e164224d 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -91,7 +91,7 @@ use middle::def_id::DefId; use middle::infer; use middle::infer::{TypeOrigin, TypeTrace, type_variable}; use middle::pat_util::{self, pat_id_map}; -use middle::subst::{self, Subst, Substs, VecPerParamSpace, ParamSpace}; +use middle::ty::subst::{self, Subst, Substs, VecPerParamSpace, ParamSpace}; use middle::traits::{self, report_fulfillment_errors, ProjectionMode}; use middle::ty::{GenericPredicates, TypeScheme}; use middle::ty::{ParamTy, ParameterEnvironment}; diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index fb4870bce8765..afbe511dda89f 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -89,7 +89,7 @@ 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::ty::subst::Substs; use middle::traits; use middle::ty::{self, Ty, TyCtxt, MethodCall, TypeFoldable}; use middle::infer::{self, GenericKind, InferCtxt, SubregionOrigin, TypeOrigin, VerifyBound}; diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index a8ada8061317e..af33b6b394e5f 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -14,7 +14,7 @@ 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::ty::subst::{self, TypeSpace, FnSpace, ParamSpace, SelfSpace}; use middle::traits; use middle::ty::{self, Ty, TyCtxt}; use middle::ty::fold::{TypeFolder}; diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 278d4d8b5b44a..af4975091055a 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -17,7 +17,7 @@ use middle::def_id::DefId; use middle::lang_items::UnsizeTraitLangItem; -use middle::subst::{self, Subst}; +use middle::ty::subst::{self, Subst}; use middle::ty::{self, TyCtxt, TypeFoldable}; use middle::traits::{self, ProjectionMode}; use middle::ty::{ImplOrTraitItemId, ConstTraitItemId}; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 3f8f31ce3ce80..a282165d1a041 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -68,7 +68,7 @@ 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::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}; diff --git a/src/librustc_typeck/constrained_type_params.rs b/src/librustc_typeck/constrained_type_params.rs index 4446063e0c7bc..016ff3b5a067b 100644 --- a/src/librustc_typeck/constrained_type_params.rs +++ b/src/librustc_typeck/constrained_type_params.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::subst; +use middle::ty::subst; use middle::ty::{self, Ty, TyCtxt}; use std::collections::HashSet; diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 4e1f3d3cbb7a9..ccc79b0748c20 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -105,7 +105,7 @@ 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::subst::Substs; use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; use middle::traits::ProjectionMode; use session::{config, CompileResult}; diff --git a/src/librustc_typeck/variance/constraints.rs b/src/librustc_typeck/variance/constraints.rs index 5c74e9096f3a7..f46edb03b95b7 100644 --- a/src/librustc_typeck/variance/constraints.rs +++ b/src/librustc_typeck/variance/constraints.rs @@ -16,8 +16,8 @@ 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::subst; +use middle::ty::subst::ParamSpace; use middle::ty::{self, Ty, TyCtxt}; use middle::ty::maps::ItemVariances; use rustc::front::map as hir_map; diff --git a/src/librustc_typeck/variance/solve.rs b/src/librustc_typeck/variance/solve.rs index fd442a4547cf9..c5e925226d07e 100644 --- a/src/librustc_typeck/variance/solve.rs +++ b/src/librustc_typeck/variance/solve.rs @@ -15,7 +15,7 @@ //! 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::subst::VecPerParamSpace; use middle::ty; use std::rc::Rc; diff --git a/src/librustc_typeck/variance/terms.rs b/src/librustc_typeck/variance/terms.rs index ff55aefb20ff3..7148afb5e856c 100644 --- a/src/librustc_typeck/variance/terms.rs +++ b/src/librustc_typeck/variance/terms.rs @@ -21,7 +21,7 @@ use arena::TypedArena; use dep_graph::DepTrackingMapConfig; -use middle::subst::{ParamSpace, FnSpace, TypeSpace, SelfSpace, VecPerParamSpace}; +use middle::ty::subst::{ParamSpace, FnSpace, TypeSpace, SelfSpace, VecPerParamSpace}; use middle::ty::{self, TyCtxt}; use middle::ty::maps::ItemVariances; use std::fmt; diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index e9c55c56a9d72..75bf1036fa2cc 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -20,7 +20,7 @@ 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::middle::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 15aeca9204a64..675bebe91c312 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -38,7 +38,7 @@ 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::subst::{self, ParamSpace, VecPerParamSpace}; use rustc::middle::ty; use rustc::middle::stability; diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs index 716b88d5534ae..4cce835899203 100644 --- a/src/librustdoc/clean/simplify.rs +++ b/src/librustdoc/clean/simplify.rs @@ -30,7 +30,7 @@ use std::mem; use std::collections::HashMap; use rustc::middle::def_id::DefId; -use rustc::middle::subst; +use rustc::middle::ty::subst; use clean::PathParameters as PP; use clean::WherePredicate as WP; From a6f69f1d5edc8cc1b1c030943d4c82daf622a711 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 22 Mar 2016 17:30:57 +0200 Subject: [PATCH 2/4] rustc: move cfg, infer, traits and ty from middle to top-level. --- src/librustc/{middle => }/cfg/construct.rs | 4 +- src/librustc/{middle => }/cfg/graphviz.rs | 2 +- src/librustc/{middle => }/cfg/mod.rs | 2 +- src/librustc/dep_graph/mod.rs | 2 +- src/librustc/{middle => }/infer/README.md | 0 src/librustc/{middle => }/infer/bivariate.rs | 6 +-- src/librustc/{middle => }/infer/combine.rs | 10 ++--- src/librustc/{middle => }/infer/equate.rs | 6 +-- .../{middle => }/infer/error_reporting.rs | 10 ++--- src/librustc/{middle => }/infer/freshen.rs | 4 +- src/librustc/{middle => }/infer/glb.rs | 4 +- .../infer/higher_ranked/README.md | 0 .../{middle => }/infer/higher_ranked/mod.rs | 6 +-- src/librustc/{middle => }/infer/lattice.rs | 6 +-- src/librustc/{middle => }/infer/lub.rs | 4 +- src/librustc/{middle => }/infer/mod.rs | 26 ++++++------ .../infer/region_inference/README.md | 0 .../infer/region_inference/graphviz.rs | 6 +-- .../infer/region_inference/mod.rs | 8 ++-- src/librustc/{middle => }/infer/resolve.rs | 2 +- src/librustc/{middle => }/infer/sub.rs | 6 +-- .../{middle => }/infer/type_variable.rs | 2 +- src/librustc/{middle => }/infer/unify_key.rs | 2 +- src/librustc/lib.rs | 12 +++--- src/librustc/lint/context.rs | 2 +- src/librustc/middle/astconv_util.rs | 2 +- src/librustc/middle/check_match.rs | 8 ++-- src/librustc/middle/const_eval.rs | 8 ++-- src/librustc/middle/cstore.rs | 6 +-- src/librustc/middle/dataflow.rs | 6 +-- src/librustc/middle/dead.rs | 6 +-- src/librustc/middle/def.rs | 2 +- src/librustc/middle/def_id.rs | 2 +- src/librustc/middle/effect.rs | 4 +- src/librustc/middle/expr_use_visitor.rs | 4 +- src/librustc/middle/free_region.rs | 4 +- src/librustc/middle/intrinsicck.rs | 6 +-- src/librustc/middle/lang_items.rs | 2 +- src/librustc/middle/liveness.rs | 8 ++-- src/librustc/middle/mem_categorization.rs | 6 +-- src/librustc/middle/pat_util.rs | 2 +- src/librustc/middle/reachable.rs | 2 +- src/librustc/middle/region.rs | 10 ++--- src/librustc/middle/resolve_lifetime.rs | 4 +- src/librustc/middle/stability.rs | 2 +- src/librustc/mir/repr.rs | 4 +- src/librustc/mir/tcx.rs | 6 +-- src/librustc/mir/transform.rs | 2 +- src/librustc/mir/visit.rs | 4 +- src/librustc/{middle => }/traits/README.md | 0 src/librustc/{middle => }/traits/coherence.rs | 6 +-- .../{middle => }/traits/error_reporting.rs | 6 +-- src/librustc/{middle => }/traits/fulfill.rs | 4 +- src/librustc/{middle => }/traits/mod.rs | 6 +-- .../{middle => }/traits/object_safety.rs | 6 +-- src/librustc/{middle => }/traits/project.rs | 8 ++-- src/librustc/{middle => }/traits/select.rs | 14 +++---- .../{middle => }/traits/specialize/mod.rs | 8 ++-- .../traits/specialize/specialization_graph.rs | 6 +-- .../{middle => }/traits/structural_impls.rs | 8 ++-- src/librustc/{middle => }/traits/util.rs | 6 +-- src/librustc/{middle => }/ty/_match.rs | 6 +-- src/librustc/{middle => }/ty/adjustment.rs | 4 +- src/librustc/{middle => }/ty/cast.rs | 2 +- src/librustc/{middle => }/ty/contents.rs | 2 +- src/librustc/{middle => }/ty/context.rs | 24 +++++------ src/librustc/{middle => }/ty/error.rs | 6 +-- src/librustc/{middle => }/ty/fast_reject.rs | 2 +- src/librustc/{middle => }/ty/flags.rs | 4 +- src/librustc/{middle => }/ty/fold.rs | 6 +-- src/librustc/{middle => }/ty/ivar.rs | 4 +- src/librustc/{middle => }/ty/maps.rs | 2 +- src/librustc/{middle => }/ty/mod.rs | 10 ++--- src/librustc/{middle => }/ty/outlives.rs | 4 +- src/librustc/{middle => }/ty/relate.rs | 6 +-- .../{middle => }/ty/structural_impls.rs | 8 ++-- src/librustc/{middle => }/ty/sty.rs | 8 ++-- src/librustc/{middle => }/ty/subst.rs | 4 +- src/librustc/{middle => }/ty/trait_def.rs | 8 ++-- src/librustc/{middle => }/ty/util.rs | 12 +++--- src/librustc/{middle => }/ty/walk.rs | 2 +- src/librustc/{middle => }/ty/wf.rs | 10 ++--- src/librustc/util/ppaux.rs | 16 ++++---- src/librustc_borrowck/borrowck/check_loans.rs | 6 +-- src/librustc_borrowck/borrowck/fragments.rs | 2 +- .../borrowck/gather_loans/gather_moves.rs | 2 +- .../borrowck/gather_loans/lifetime.rs | 2 +- .../borrowck/gather_loans/mod.rs | 6 +-- .../borrowck/gather_loans/move_error.rs | 2 +- .../borrowck/gather_loans/restrictions.rs | 2 +- .../borrowck/mir/dataflow.rs | 4 +- .../borrowck/mir/gather_moves.rs | 2 +- src/librustc_borrowck/borrowck/mod.rs | 4 +- src/librustc_borrowck/borrowck/move_data.rs | 4 +- src/librustc_borrowck/graphviz.rs | 6 +-- src/librustc_driver/driver.rs | 4 +- src/librustc_driver/pretty.rs | 6 +-- src/librustc_driver/test.rs | 30 +++++++------- src/librustc_lint/bad_style.rs | 2 +- src/librustc_lint/builtin.rs | 11 ++--- src/librustc_lint/types.rs | 6 +-- src/librustc_lint/unused.rs | 4 +- src/librustc_metadata/astencode.rs | 8 ++-- src/librustc_metadata/csearch.rs | 2 +- src/librustc_metadata/decoder.rs | 6 +-- src/librustc_metadata/encoder.rs | 8 ++-- src/librustc_metadata/tls_context.rs | 4 +- src/librustc_metadata/tydecode.rs | 6 +-- src/librustc_metadata/tyencode.rs | 8 ++-- src/librustc_mir/build/expr/into.rs | 2 +- src/librustc_mir/build/matches/mod.rs | 2 +- src/librustc_mir/build/matches/test.rs | 2 +- src/librustc_mir/build/misc.rs | 2 +- src/librustc_mir/build/mod.rs | 2 +- src/librustc_mir/build/scope.rs | 4 +- src/librustc_mir/graphviz.rs | 2 +- src/librustc_mir/hair/cx/expr.rs | 2 +- src/librustc_mir/hair/cx/mod.rs | 6 +-- src/librustc_mir/hair/cx/pattern.rs | 2 +- src/librustc_mir/hair/mod.rs | 4 +- src/librustc_mir/mir_map.rs | 6 +-- src/librustc_mir/pretty.rs | 2 +- src/librustc_mir/transform/erase_regions.rs | 2 +- src/librustc_mir/transform/no_landing_pads.rs | 2 +- .../transform/remove_dead_blocks.rs | 2 +- src/librustc_mir/transform/simplify_cfg.rs | 2 +- src/librustc_mir/transform/type_check.rs | 8 ++-- src/librustc_passes/consts.rs | 8 ++-- src/librustc_passes/rvalues.rs | 6 +-- src/librustc_platform_intrinsics/aarch64.rs | 2 +- src/librustc_platform_intrinsics/arm.rs | 2 +- src/librustc_platform_intrinsics/lib.rs | 2 +- src/librustc_platform_intrinsics/x86.rs | 2 +- src/librustc_privacy/lib.rs | 2 +- src/librustc_resolve/build_reduced_graph.rs | 2 +- src/librustc_resolve/lib.rs | 4 +- src/librustc_trans/back/link.rs | 2 +- src/librustc_trans/save/data.rs | 2 +- src/librustc_trans/save/dump_visitor.rs | 2 +- src/librustc_trans/save/mod.rs | 2 +- src/librustc_trans/trans/_match.rs | 8 ++-- src/librustc_trans/trans/abi.rs | 4 +- src/librustc_trans/trans/adt.rs | 4 +- src/librustc_trans/trans/assert_dep_graph.rs | 2 +- src/librustc_trans/trans/base.rs | 12 +++--- src/librustc_trans/trans/callee.rs | 10 ++--- src/librustc_trans/trans/cleanup.rs | 2 +- src/librustc_trans/trans/closure.rs | 6 +-- src/librustc_trans/trans/collector.rs | 10 ++--- src/librustc_trans/trans/common.rs | 12 +++--- src/librustc_trans/trans/consts.rs | 10 ++--- src/librustc_trans/trans/context.rs | 6 +-- src/librustc_trans/trans/controlflow.rs | 2 +- src/librustc_trans/trans/datum.rs | 2 +- .../trans/debuginfo/metadata.rs | 6 +-- src/librustc_trans/trans/debuginfo/mod.rs | 8 ++-- .../trans/debuginfo/type_names.rs | 6 +-- src/librustc_trans/trans/declare.rs | 4 +- src/librustc_trans/trans/disr.rs | 4 +- src/librustc_trans/trans/expr.rs | 20 +++++----- src/librustc_trans/trans/glue.rs | 6 +-- src/librustc_trans/trans/inline.rs | 2 +- src/librustc_trans/trans/intrinsic.rs | 14 +++---- src/librustc_trans/trans/meth.rs | 10 ++--- src/librustc_trans/trans/mir/block.rs | 2 +- src/librustc_trans/trans/mir/constant.rs | 2 +- src/librustc_trans/trans/mir/drop.rs | 2 +- src/librustc_trans/trans/mir/lvalue.rs | 2 +- src/librustc_trans/trans/mir/mod.rs | 2 +- src/librustc_trans/trans/mir/operand.rs | 2 +- src/librustc_trans/trans/mir/rvalue.rs | 4 +- src/librustc_trans/trans/monomorphize.rs | 10 ++--- src/librustc_trans/trans/tvec.rs | 2 +- src/librustc_trans/trans/type_of.rs | 10 ++--- src/librustc_typeck/astconv.rs | 8 ++-- src/librustc_typeck/check/_match.rs | 6 +-- src/librustc_typeck/check/assoc.rs | 6 +-- src/librustc_typeck/check/callee.rs | 4 +- src/librustc_typeck/check/cast.rs | 8 ++-- src/librustc_typeck/check/closure.rs | 4 +- src/librustc_typeck/check/coercion.rs | 20 +++++----- src/librustc_typeck/check/compare_method.rs | 8 ++-- src/librustc_typeck/check/demand.rs | 4 +- src/librustc_typeck/check/dropck.rs | 8 ++-- src/librustc_typeck/check/intrinsic.rs | 8 ++-- src/librustc_typeck/check/method/confirm.rs | 14 +++---- src/librustc_typeck/check/method/mod.rs | 10 ++--- src/librustc_typeck/check/method/probe.rs | 12 +++--- src/librustc_typeck/check/method/suggest.rs | 6 +-- src/librustc_typeck/check/mod.rs | 40 +++++++++---------- src/librustc_typeck/check/op.rs | 4 +- src/librustc_typeck/check/regionck.rs | 12 +++--- src/librustc_typeck/check/upvar.rs | 4 +- src/librustc_typeck/check/wfcheck.rs | 8 ++-- src/librustc_typeck/check/writeback.rs | 8 ++-- src/librustc_typeck/coherence/mod.rs | 26 ++++++------ src/librustc_typeck/coherence/orphan.rs | 4 +- src/librustc_typeck/coherence/overlap.rs | 6 +-- src/librustc_typeck/coherence/unsafety.rs | 2 +- src/librustc_typeck/collect.rs | 12 +++--- .../constrained_type_params.rs | 4 +- src/librustc_typeck/lib.rs | 8 ++-- src/librustc_typeck/rscope.rs | 2 +- src/librustc_typeck/variance/constraints.rs | 8 ++-- src/librustc_typeck/variance/mod.rs | 2 +- src/librustc_typeck/variance/solve.rs | 4 +- src/librustc_typeck/variance/terms.rs | 6 +-- src/librustc_typeck/variance/xform.rs | 2 +- src/librustdoc/clean/inline.rs | 4 +- src/librustdoc/clean/mod.rs | 6 +-- src/librustdoc/clean/simplify.rs | 4 +- src/librustdoc/core.rs | 2 +- src/test/auxiliary/dummy_mir_pass.rs | 2 +- ...s-based-on-type-cyclic-types-issue-4821.rs | 2 +- src/test/run-make/execution-engine/test.rs | 2 +- 215 files changed, 614 insertions(+), 613 deletions(-) rename src/librustc/{middle => }/cfg/construct.rs (99%) rename src/librustc/{middle => }/cfg/graphviz.rs (99%) rename src/librustc/{middle => }/cfg/mod.rs (98%) rename src/librustc/{middle => }/infer/README.md (100%) rename src/librustc/{middle => }/infer/bivariate.rs (97%) rename src/librustc/{middle => }/infer/combine.rs (98%) rename src/librustc/{middle => }/infer/equate.rs (96%) rename src/librustc/{middle => }/infer/error_reporting.rs (99%) rename src/librustc/{middle => }/infer/freshen.rs (98%) rename src/librustc/{middle => }/infer/glb.rs (96%) rename src/librustc/{middle => }/infer/higher_ranked/README.md (100%) rename src/librustc/{middle => }/infer/higher_ranked/mod.rs (99%) rename src/librustc/{middle => }/infer/lattice.rs (96%) rename src/librustc/{middle => }/infer/lub.rs (96%) rename src/librustc/{middle => }/infer/mod.rs (98%) rename src/librustc/{middle => }/infer/region_inference/README.md (100%) rename src/librustc/{middle => }/infer/region_inference/graphviz.rs (98%) rename src/librustc/{middle => }/infer/region_inference/mod.rs (99%) rename src/librustc/{middle => }/infer/resolve.rs (99%) rename src/librustc/{middle => }/infer/sub.rs (96%) rename src/librustc/{middle => }/infer/type_variable.rs (99%) rename src/librustc/{middle => }/infer/unify_key.rs (98%) rename src/librustc/{middle => }/traits/README.md (100%) rename src/librustc/{middle => }/traits/coherence.rs (98%) rename src/librustc/{middle => }/traits/error_reporting.rs (99%) rename src/librustc/{middle => }/traits/fulfill.rs (99%) rename src/librustc/{middle => }/traits/mod.rs (99%) rename src/librustc/{middle => }/traits/object_safety.rs (99%) rename src/librustc/{middle => }/traits/project.rs (99%) rename src/librustc/{middle => }/traits/select.rs (99%) rename src/librustc/{middle => }/traits/specialize/mod.rs (98%) rename src/librustc/{middle => }/traits/specialize/specialization_graph.rs (99%) rename src/librustc/{middle => }/traits/structural_impls.rs (98%) rename src/librustc/{middle => }/traits/util.rs (99%) rename src/librustc/{middle => }/ty/_match.rs (96%) rename src/librustc/{middle => }/ty/adjustment.rs (98%) rename src/librustc/{middle => }/ty/cast.rs (98%) rename src/librustc/{middle => }/ty/contents.rs (99%) rename src/librustc/{middle => }/ty/context.rs (98%) rename src/librustc/{middle => }/ty/error.rs (99%) rename src/librustc/{middle => }/ty/fast_reject.rs (99%) rename src/librustc/{middle => }/ty/flags.rs (98%) rename src/librustc/{middle => }/ty/fold.rs (99%) rename src/librustc/{middle => }/ty/ivar.rs (98%) rename src/librustc/{middle => }/ty/maps.rs (99%) rename src/librustc/{middle => }/ty/mod.rs (99%) rename src/librustc/{middle => }/ty/outlives.rs (99%) rename src/librustc/{middle => }/ty/relate.rs (99%) rename src/librustc/{middle => }/ty/structural_impls.rs (99%) rename src/librustc/{middle => }/ty/sty.rs (99%) rename src/librustc/{middle => }/ty/subst.rs (99%) rename src/librustc/{middle => }/ty/trait_def.rs (98%) rename src/librustc/{middle => }/ty/util.rs (99%) rename src/librustc/{middle => }/ty/walk.rs (99%) rename src/librustc/{middle => }/ty/wf.rs (99%) 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 dcfa8d1e36a21..e75625f7fae42 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 c9c712c2d6e10..c867ec94b2510 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 394633c59114d..8df4dc5fce596 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 821217d75821c..731c33868dfbf 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 76a87675e3da6..a9ea395e6b3cd 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 f67389e3c3b00..2b30698882d62 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 dd576c75ba3b4..3c9c9c5788414 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 7a1da77453147..20c0134414484 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::ty::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 b0f6d45dc53f1..352733a595da6 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 7779be896cf57..235428a6898a9 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 44ba6ec4a7a7d..db4ee17bafbbd 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 dc4cbd14a5da2..17ad32e742e02 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 7202e4afc5a46..00b85929b4b15 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 98% rename from src/librustc/middle/infer/mod.rs rename to src/librustc/infer/mod.rs index ea11ade1d16dd..bc4c9fd2ccfcf 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::ty::subst; -use middle::ty::subst::Substs; -use middle::ty::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 23559e7b340eb..e561f4a354891 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 7bba495e46779..2b74dcb40c4a3 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 8c6105898446a..c54843410adb8 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 e94311697c35a..0505c9d627b9b 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 fe66ea5a1ea12..c8da346085d64 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 3f8c3fbce047a..a9eb20b82997f 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 37b6ea7872aad..4fdfe59e2b041 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,8 +115,6 @@ pub mod middle { pub mod recursion_limit; pub mod resolve_lifetime; pub mod stability; - pub mod traits; - pub mod ty; pub mod weak_lang_items; } @@ -127,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 079a0c94cc5a5..8224422d45c97 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 e17aaaca16e04..a6907aad297c1 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 b5e1d5899967f..79ec53ff0cf92 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 5cb5595e9e8ed..2b1bfb144f6f3 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -17,13 +17,13 @@ use self::EvalHint::*; use front::map as ast_map; use front::map::blocks::FnLikeNode; use middle::cstore::{self, CrateStore, InlinedItem}; -use middle::{infer, traits}; +use {infer, traits}; use middle::def::Def; use middle::def_id::DefId; use middle::pat_util::def_to_path; -use middle::ty::{self, subst, 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 9a3550b65aa2d..53273c9e09600 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; @@ -454,8 +454,8 @@ pub mod tls { use serialize; use std::cell::Cell; use std::mem; - use middle::ty::{self, Ty, TyCtxt}; - use middle::ty::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 d8cffa3c2c9f9..6468187e219bf 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 4ceac287d19df..2b8ed14701df5 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 f832a871c8b1b..6cbcd41d84a40 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::ty::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 f5bdf28a4b134..a3b83ec5be4bd 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 d4ff4b797c839..fa949073f4e2b 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 ded64fa1d3057..744022d1d5ec4 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 cb45a3e2507c9..20f2c5ad43fbb 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 e3da34acb4b43..939ea91cdd44e 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::ty::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 b08c2d6054c89..bb0b8ed91df86 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 ee39a4fc7df6e..f6eedb49e2476 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::ty::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 d2bc80a2cb203..6328f920cb741 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 81166945115bb..b2b1344c4bb75 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 601f069513d12..2e01a7fc249ec 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 eb375205deee1..1d1d05ea79f17 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 8d3a80854b467..6342599bf734d 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::ty::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 2d92742ed0f20..3a2f995a31824 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 20cf6d929ca7c..b90738107834d 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::ty::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 0c9e00a6c5ec4..46d99dbef8c61 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -14,9 +14,9 @@ */ use mir::repr::*; -use middle::ty::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 afcb5b956319d..410e3f9d06628 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 bc0056b0af02f..9fa502166ba9f 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 547cb71f234f0..b5b5da6208034 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::ty::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 dd051471a4d1b..c26aaeaf14316 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 937196b5e8e7a..67bb8c89ddf62 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 9404731859961..867bd054fa9dd 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::ty::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 8777b9eb00cfd..7cd2ac5938d41 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::ty::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 bd075a5dc88db..3adaf5fa6bb2f 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::ty::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 050468809a5ac..e2a48688d4bbc 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::ty::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 088099d87b158..e0ce54115ebc2 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::ty::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 f2170f75a11fe..eaafeb1a969b3 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 903b7c80bafab..367e5f32ba3ec 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 f9a1b09a93d2c..f339b6e50cedd 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::ty::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 fe54334da3db6..d0ccc3e0fdd80 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 e4c293a74e896..dc2117b1ad119 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 b25d6e0476d98..c8d282d18af1d 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 47a15a14b41ee..cb84b198222a2 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 aa0ac62ac5719..3803297fcc1c8 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::ty::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; @@ -617,7 +617,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; @@ -677,7 +677,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 8e1ace57e42ad..9ab4850582853 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::ty::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 fc4db22a8a62f..0865e059f59c5 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 12b2426150797..f3dcccedc594b 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::ty::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 2e8782a72f691..d04f272688c8c 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::ty::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/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 ffc12aa5aea19..b0f443fc19b42 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 8d8afc199f59e..77b6b03e48fe9 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 c5f10c332fc0a..82f08a5a73d28 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::traits; -use middle::ty; -use middle::ty::fold::TypeFolder; -use middle::ty::subst::{Subst, Substs, VecPerParamSpace}; -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; 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 9439180a6cd21..898c9d65c7826 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 d648c2c588476..bb4f13b13c1ec 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::ty::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 23ec75b18e82c..6fca1eef701c0 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::ty::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 d8f0dd2903196..dae12824da251 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::ty::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/ty/subst.rs b/src/librustc/ty/subst.rs similarity index 99% rename from src/librustc/middle/ty/subst.rs rename to src/librustc/ty/subst.rs index b9bf550704e02..8d25728212109 100644 --- a/src/librustc/middle/ty/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 3d7b3bf263425..3ebf2ba4c849f 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 f6c4390b83c96..b870dc47ec76a 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::ty::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 b6d93ecf78b88..fa7c9b782311f 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 1becdb14fa534..e6c4e90babbf5 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::ty::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 f67346fe1f940..20f16a1d255c7 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -10,14 +10,14 @@ use middle::def_id::DefId; -use middle::ty::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 9186765e6d02c..aa2b7ed2cdeea 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 3d6e9c8868c92..2d38b665cf90b 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 4e507284a1b46..107109c91154b 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 84dce6d35702a..c2492bba62473 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 2d255c054548f..247f8121de797 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 4cb9673785ecb..f49554289b3ee 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 2a0d8ef276648..ee8c3aff2ec80 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 3c3a60b995ff0..a8176c060a104 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 46eb3d3ca03e5..dbe5879934158 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 bb2fe7acb9536..d985359a3dd21 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 4c645d4bb69bd..00274fe1a040c 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 fd23772bcda13..0da9525efd856 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/driver.rs b/src/librustc_driver/driver.rs index 55b873c06630a..3520d74187583 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_borrowck as borrowck; diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 726dd02dd2567..31345cfdc41ab 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 abbea81897173..adea9517500f2 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::ty::subst; -use rustc_typeck::middle::ty::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 e399270197e2b..66d435a7581d9 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 66e19cf29bf9e..339c969b01fcd 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::ty::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 3dfd265c5a020..6322f59257310 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::ty::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 36ed06a6c00b4..9840cd4256fcf 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 1cf6c9b53e2c5..852b5f476a6d3 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::ty::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 9ac7216165caf..8628198423e41 100644 --- a/src/librustc_metadata/csearch.rs +++ b/src/librustc_metadata/csearch.rs @@ -17,7 +17,7 @@ use middle::cstore::{CrateStore, CrateSource, ChildItem, 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 f88552707437b..cc7138243bd06 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::ty::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 dc338048a83af..7d7ab48ee1613 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::ty::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 2ba3e351c50aa..6ecd7a7f50ad8 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::ty::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 8c88a63a161f4..ed59fce77a02c 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::ty::subst; -use middle::ty::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 5086977ea0637..e8ff46f427b52 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::ty::subst; -use middle::ty::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 30c039cdde0c3..231d7da10a02d 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 b1286e935b684..581e8e35ee89f 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 3211e5849a06c..5a1c3739ef5f0 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 0d1690783301b..86f15a6319399 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 b79f492179fb9..82f7ddebf0bce 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 033e1361d4a8c..bac7b310dc701 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::ty::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 a5e749ea6870e..959b1fdef5270 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 4d87d926e4055..aa55ee3e3f729 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 d603979906dda..30467a981d914 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::ty::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 a987377837417..0391d5b843469 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 3eca7f0a8772c..79c8356bb557a 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::ty::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 5a6e2edfdf9e7..21cc8d35320a3 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 834897f8eaee0..2c50697c37f69 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 d8aa0d9b72503..addf87e3356e5 100644 --- a/src/librustc_mir/transform/erase_regions.rs +++ b/src/librustc_mir/transform/erase_regions.rs @@ -12,7 +12,7 @@ //! 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::ty::{self, TyCtxt}; +use rustc::ty::{self, 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 0e9a18107870e..edfe75b8430d4 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 4513aeef86d91..dc1ddad124f87 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 21b1d022fda60..cbde292cb995b 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 c0605ebe6d4a8..6cfde27ac97b6 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 c2b764594180c..571d5bd9bc5a3 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 88048b514e1f5..98502f5a16e78 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 59986a905a2ec..97fe632a529f8 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 d71f59e8e68cd..65751d652321c 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 53976308bdc19..9736d5587693e 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 eccdc77f33c9d..de9d3dcf3550f 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 79ccc8fb2b21f..304932df412ad 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 08b5e51729013..0185024938472 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -28,7 +28,7 @@ use {resolve_error, resolve_struct_error, ResolutionError}; use rustc::middle::cstore::{CrateStore, ChildItem, DlDef, DlField, DlImpl}; 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 62443efbe2ab9..72162806d8652 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -55,8 +55,8 @@ use rustc::middle::cstore::{CrateStore, DefLike, DlDef}; use rustc::middle::def::*; use rustc::middle::def_id::DefId; use rustc::middle::pat_util::pat_bindings; -use rustc::middle::ty::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_trans/back/link.rs b/src/librustc_trans/back/link.rs index acb458f8cc6ee..bcb56f4baf669 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 middle::ty::{Ty, TyCtxt}; +use rustc::ty::{Ty, TyCtxt}; use rustc::front::map::DefPath; use trans::{CrateContext, CrateTranslation, gensym_name}; use util::common::time; diff --git a/src/librustc_trans/save/data.rs b/src/librustc_trans/save/data.rs index 3eaaa3fc4930c..b9d9d58b5bdcd 100644 --- a/src/librustc_trans/save/data.rs +++ b/src/librustc_trans/save/data.rs @@ -16,7 +16,7 @@ use std::hash::Hasher; use middle::def_id::DefId; -use middle::ty; +use rustc::ty; use syntax::ast::{CrateNum, NodeId}; use syntax::codemap::Span; diff --git a/src/librustc_trans/save/dump_visitor.rs b/src/librustc_trans/save/dump_visitor.rs index 65f48d1ff5eb5..9d465d8704708 100644 --- a/src/librustc_trans/save/dump_visitor.rs +++ b/src/librustc_trans/save/dump_visitor.rs @@ -31,7 +31,7 @@ use session::Session; use middle::def::Def; use middle::def_id::DefId; -use middle::ty::{self, TyCtxt}; +use rustc::ty::{self, TyCtxt}; use std::collections::HashSet; use std::hash::*; diff --git a/src/librustc_trans/save/mod.rs b/src/librustc_trans/save/mod.rs index 78e91e00baa71..a037f8d6ea0eb 100644 --- a/src/librustc_trans/save/mod.rs +++ b/src/librustc_trans/save/mod.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::ty::{self, TyCtxt}; +use rustc::ty::{self, TyCtxt}; use middle::def::Def; use middle::def_id::DefId; diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index 561fd022ecef5..7794ac763c6a1 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -195,12 +195,12 @@ 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::ty::subst::Substs; +use rustc::ty::subst::Substs; use trans::adt; use trans::base::*; use trans::build::{AddCase, And, Br, CondBr, GEPi, InBoundsGEP, Load, PointerCast}; @@ -218,8 +218,8 @@ 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::{self, Ty, TyCtxt}; +use rustc::traits::ProjectionMode; use session::config::NoDebugInfo; use util::common::indenter; use util::nodemap::FnvHashMap; diff --git a/src/librustc_trans/trans/abi.rs b/src/librustc_trans/trans/abi.rs index fd086522b2ea3..8725392417288 100644 --- a/src/librustc_trans/trans/abi.rs +++ b/src/librustc_trans/trans/abi.rs @@ -27,7 +27,7 @@ use trans::type_::Type; use trans::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/trans/adt.rs index e94c4ebe3b56b..f14c1a573cccc 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -48,8 +48,8 @@ use std; use std::rc::Rc; use llvm::{ValueRef, True, IntEQ, IntNE}; -use middle::ty::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; diff --git a/src/librustc_trans/trans/assert_dep_graph.rs b/src/librustc_trans/trans/assert_dep_graph.rs index 11386715492b6..dcf23039e2563 100644 --- a/src/librustc_trans/trans/assert_dep_graph.rs +++ b/src/librustc_trans/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/base.rs b/src/librustc_trans/trans/base.rs index 9892cf67e8afe..ae7e6a924ab9c 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -34,17 +34,17 @@ use back::link; 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::ty::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; diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index ff806ac5125ee..4c9999d49624e 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -22,10 +22,10 @@ use back::link; use llvm::{self, ValueRef, get_params}; use middle::cstore::LOCAL_CRATE; use middle::def_id::DefId; -use middle::infer; -use middle::ty::subst; -use middle::ty::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; @@ -53,7 +53,7 @@ use trans::type_::Type; use trans::type_of; use trans::value::Value; use trans::Disr; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +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/trans/cleanup.rs index bd2d05915f6db..78481e0ed9251 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -130,7 +130,7 @@ use trans::glue; use middle::region; use trans::type_::Type; use trans::value::Value; -use middle::ty::{Ty, TyCtxt}; +use rustc::ty::{Ty, TyCtxt}; use std::fmt; use syntax::ast; diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs index dbabc3f54c594..7b71109f5a2fa 100644 --- a/src/librustc_trans/trans/closure.rs +++ b/src/librustc_trans/trans/closure.rs @@ -12,8 +12,8 @@ use arena::TypedArena; use back::link::{self, mangle_internal_name_by_path_and_seq}; use llvm::{ValueRef, get_param, get_params}; use middle::def_id::DefId; -use middle::infer; -use middle::traits::ProjectionMode; +use rustc::infer; +use rustc::traits::ProjectionMode; use trans::abi::{Abi, FnType}; use trans::adt; use trans::attributes; @@ -30,7 +30,7 @@ use trans::expr; use trans::monomorphize::{Instance}; use trans::value::Value; use trans::Disr; -use middle::ty::{self, Ty, TyCtxt}; +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/trans/collector.rs index fbd58fbea085d..07989c4290db1 100644 --- a/src/librustc_trans/trans/collector.rs +++ b/src/librustc_trans/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::ty::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; @@ -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 diff --git a/src/librustc_trans/trans/common.rs b/src/librustc_trans/trans/common.rs index eb443a3b0b977..a6953f262c8ce 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/trans/common.rs @@ -16,12 +16,12 @@ 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::ty::subst::Substs; +use rustc::ty::subst::Substs; use trans::abi::{Abi, FnType}; use trans::base; use trans::build; @@ -37,9 +37,9 @@ 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::{self, Ty, TyCtxt}; +use rustc::traits::{self, SelectionContext, ProjectionMode}; +use rustc::ty::fold::{TypeFolder, TypeFoldable}; use rustc_front::hir; use util::nodemap::NodeMap; diff --git a/src/librustc_trans/trans/consts.rs b/src/librustc_trans/trans/consts.rs index cb4092ffb9eba..9cdb168df8543 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -32,11 +32,11 @@ use trans::type_::Type; use trans::type_of; use trans::value::Value; use trans::Disr; -use middle::ty::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 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/trans/context.rs index db2b5b86a7e0b..2da61c49ed20d 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -14,7 +14,7 @@ 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; @@ -28,8 +28,8 @@ use trans::mir::CachedMir; use trans::monomorphize::Instance; use trans::collector::{TransItem, TransItemState}; use trans::type_::{Type, TypeNames}; -use middle::ty::subst::{Substs, VecPerParamSpace}; -use middle::ty::{self, Ty, TyCtxt}; +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/trans/controlflow.rs index 65f5ab1f22818..80ff11e968a18 100644 --- a/src/librustc_trans/trans/controlflow.rs +++ b/src/librustc_trans/trans/controlflow.rs @@ -11,7 +11,7 @@ use llvm::ValueRef; use middle::def::Def; use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem}; -use middle::ty::subst::Substs; +use rustc::ty::subst::Substs; use trans::base::*; use trans::basic_block::BasicBlock; use trans::build::*; diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 649f6180de20b..c0858a6d93bf6 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -102,7 +102,7 @@ use trans::cleanup::{CleanupMethods, DropHintDatum, DropHintMethods}; use trans::expr; use trans::tvec; use trans::value::Value; -use middle::ty::Ty; +use rustc::ty::Ty; use std::fmt; use syntax::ast; diff --git a/src/librustc_trans/trans/debuginfo/metadata.rs b/src/librustc_trans/trans/debuginfo/metadata.rs index a654a3f37c8da..bd2a8e0193dae 100644 --- a/src/librustc_trans/trans/debuginfo/metadata.rs +++ b/src/librustc_trans/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::ty::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 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/trans/debuginfo/mod.rs index dbba03cf4551f..198a9899fdae0 100644 --- a/src/librustc_trans/trans/debuginfo/mod.rs +++ b/src/librustc_trans/trans/debuginfo/mod.rs @@ -27,8 +27,8 @@ 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::ty::subst::{self, Substs}; +use rustc::infer::normalize_associated_type; +use rustc::ty::subst::{self, Substs}; use rustc_front; use rustc_front::hir; @@ -36,8 +36,8 @@ 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 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; diff --git a/src/librustc_trans/trans/debuginfo/type_names.rs b/src/librustc_trans/trans/debuginfo/type_names.rs index a051966795d55..fc9ace89ab7c3 100644 --- a/src/librustc_trans/trans/debuginfo/type_names.rs +++ b/src/librustc_trans/trans/debuginfo/type_names.rs @@ -14,9 +14,9 @@ use super::namespace::crate_root_namespace; use trans::common::CrateContext; use middle::def_id::DefId; -use middle::infer; -use middle::ty::subst; -use middle::ty::{self, Ty}; +use rustc::infer; +use rustc::ty::subst; +use rustc::ty::{self, Ty}; use rustc_front::hir; diff --git a/src/librustc_trans/trans/declare.rs b/src/librustc_trans/trans/declare.rs index e63f17770bcec..41a87f8d6de46 100644 --- a/src/librustc_trans/trans/declare.rs +++ b/src/librustc_trans/trans/declare.rs @@ -20,8 +20,8 @@ //! * 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 rustc::ty; +use rustc::infer; use trans::abi::{Abi, FnType}; use trans::attributes; use trans::context::CrateContext; diff --git a/src/librustc_trans/trans/disr.rs b/src/librustc_trans/trans/disr.rs index d74c1ac50ad74..fc79fa813aa5a 100644 --- a/src/librustc_trans/trans/disr.rs +++ b/src/librustc_trans/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/trans/expr.rs index 8b7527fd7de64..8f9f44fb2ddf8 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -54,7 +54,7 @@ use self::lazy_binop_ty::*; use llvm::{self, ValueRef, TypeKind}; use middle::const_qualif::ConstQualif; use middle::def::Def; -use middle::ty::subst::Substs; +use rustc::ty::subst::Substs; use trans::{_match, abi, adt, asm, base, closure, consts, controlflow}; use trans::base::*; use trans::build::*; @@ -70,12 +70,12 @@ 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::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; @@ -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/trans/glue.rs index 02a14715ab28b..596d8c7e9b7a2 100644 --- a/src/librustc_trans/trans/glue.rs +++ b/src/librustc_trans/trans/glue.rs @@ -18,9 +18,9 @@ use back::link; use llvm; use llvm::{ValueRef, get_param}; use middle::lang_items::ExchangeFreeFnLangItem; -use middle::ty::subst::{Substs}; -use middle::traits; -use middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::subst::{Substs}; +use rustc::traits; +use rustc::ty::{self, Ty, TyCtxt}; use trans::abi::{Abi, FnType}; use trans::adt; use trans::adt::GetDtorType; // for tcx.dtor_type() diff --git a/src/librustc_trans/trans/inline.rs b/src/librustc_trans/trans/inline.rs index 87b4a572884ec..85a2adfe0df7b 100644 --- a/src/librustc_trans/trans/inline.rs +++ b/src/librustc_trans/trans/inline.rs @@ -11,7 +11,7 @@ use llvm::{AvailableExternallyLinkage, InternalLinkage, SetLinkage}; use middle::cstore::{CrateStore, FoundAst, InlinedItem}; use middle::def_id::DefId; -use middle::ty::subst::Substs; +use rustc::ty::subst::Substs; use trans::base::{push_ctxt, trans_item, trans_fn}; use trans::callee::Callee; use trans::common::*; diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index d3b84fbac1a9b..9577a1817d75d 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -15,9 +15,9 @@ use intrinsics::{self, Intrinsic}; use libc; use llvm; use llvm::{ValueRef, TypeKind}; -use middle::infer; -use middle::ty::subst; -use middle::ty::subst::FnSpace; +use rustc::infer; +use rustc::ty::subst; +use rustc::ty::subst::FnSpace; use trans::abi::{Abi, FnType}; use trans::adt; use trans::attributes; @@ -36,9 +36,9 @@ use trans::glue; use trans::type_of; use trans::machine; use trans::type_::Type; -use middle::ty::{self, Ty, TypeFoldable}; +use rustc::ty::{self, Ty, TypeFoldable}; use trans::Disr; -use middle::ty::subst::Substs; +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/trans/meth.rs b/src/librustc_trans/trans/meth.rs index d86f0c4e6dff3..86ddc86e40744 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/trans/meth.rs @@ -14,10 +14,10 @@ use arena::TypedArena; use back::link; use llvm::{ValueRef, get_params}; use middle::def_id::DefId; -use middle::infer; -use middle::ty::subst::{FnSpace, Subst, Substs}; -use middle::ty::subst; -use middle::traits::{self, ProjectionMode}; +use rustc::infer; +use rustc::ty::subst::{FnSpace, Subst, Substs}; +use rustc::ty::subst; +use rustc::traits::{self, ProjectionMode}; use trans::abi::FnType; use trans::base::*; use trans::build::*; @@ -33,7 +33,7 @@ use trans::machine; use trans::type_::Type; use trans::type_of::*; use trans::value::Value; -use middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use syntax::ast::Name; use syntax::codemap::DUMMY_SP; diff --git a/src/librustc_trans/trans/mir/block.rs b/src/librustc_trans/trans/mir/block.rs index 7abaeb44c1c29..4f76fd5668456 100644 --- a/src/librustc_trans/trans/mir/block.rs +++ b/src/librustc_trans/trans/mir/block.rs @@ -9,7 +9,7 @@ // 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; diff --git a/src/librustc_trans/trans/mir/constant.rs b/src/librustc_trans/trans/mir/constant.rs index d4934718d75ed..1e5c1c2c55a00 100644 --- a/src/librustc_trans/trans/mir/constant.rs +++ b/src/librustc_trans/trans/mir/constant.rs @@ -9,7 +9,7 @@ // 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; diff --git a/src/librustc_trans/trans/mir/drop.rs b/src/librustc_trans/trans/mir/drop.rs index 2e13abec5e36c..cc033084ace60 100644 --- a/src/librustc_trans/trans/mir/drop.rs +++ b/src/librustc_trans/trans/mir/drop.rs @@ -9,7 +9,7 @@ // except according to those terms. use llvm::ValueRef; -use rustc::middle::ty::Ty; +use rustc::ty::Ty; use trans::adt; use trans::base; use trans::common::{self, BlockAndBuilder}; diff --git a/src/librustc_trans/trans/mir/lvalue.rs b/src/librustc_trans/trans/mir/lvalue.rs index ffc3b1206746e..6271ad8d8b846 100644 --- a/src/librustc_trans/trans/mir/lvalue.rs +++ b/src/librustc_trans/trans/mir/lvalue.rs @@ -9,7 +9,7 @@ // 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; diff --git a/src/librustc_trans/trans/mir/mod.rs b/src/librustc_trans/trans/mir/mod.rs index 9df2cb712b14f..ed4aa5fe58304 100644 --- a/src/librustc_trans/trans/mir/mod.rs +++ b/src/librustc_trans/trans/mir/mod.rs @@ -10,7 +10,7 @@ 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; diff --git a/src/librustc_trans/trans/mir/operand.rs b/src/librustc_trans/trans/mir/operand.rs index 6df4502fbc827..cc1446033de33 100644 --- a/src/librustc_trans/trans/mir/operand.rs +++ b/src/librustc_trans/trans/mir/operand.rs @@ -9,7 +9,7 @@ // 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}; diff --git a/src/librustc_trans/trans/mir/rvalue.rs b/src/librustc_trans/trans/mir/rvalue.rs index 17c8aef244bb9..a78d0da5be4a7 100644 --- a/src/librustc_trans/trans/mir/rvalue.rs +++ b/src/librustc_trans/trans/mir/rvalue.rs @@ -9,8 +9,8 @@ // 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; diff --git a/src/librustc_trans/trans/monomorphize.rs b/src/librustc_trans/trans/monomorphize.rs index 986d05af92f2c..a587de2e2db92 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/trans/monomorphize.rs @@ -12,17 +12,17 @@ use back::link::exported_name; use llvm::ValueRef; use llvm; use middle::def_id::DefId; -use middle::infer::normalize_associated_type; -use middle::ty::subst; -use middle::ty::subst::{Subst, Substs}; -use middle::ty::fold::{TypeFolder, TypeFoldable}; +use rustc::infer::normalize_associated_type; +use rustc::ty::subst; +use rustc::ty::subst::{Subst, Substs}; +use rustc::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 middle::ty::{self, Ty, TyCtxt}; +use rustc::ty::{self, Ty, TyCtxt}; use trans::Disr; use rustc::front::map as hir_map; use rustc::util::ppaux; diff --git a/src/librustc_trans/trans/tvec.rs b/src/librustc_trans/trans/tvec.rs index 7a0ca86f5a270..4a7404b1fbacd 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/trans/tvec.rs @@ -27,7 +27,7 @@ use trans::machine::llsize_of_alloc; use trans::type_::Type; use trans::type_of; use trans::value::Value; -use middle::ty::{self, Ty}; +use rustc::ty::{self, Ty}; use rustc_front::hir; diff --git a/src/librustc_trans/trans/type_of.rs b/src/librustc_trans/trans/type_of.rs index e81039908c173..00f42a3b243c7 100644 --- a/src/librustc_trans/trans/type_of.rs +++ b/src/librustc_trans/trans/type_of.rs @@ -11,13 +11,13 @@ #![allow(non_camel_case_types)] use middle::def_id::DefId; -use middle::infer; -use middle::ty::subst; +use rustc::infer; +use rustc::ty::subst; use trans::abi::FnType; use trans::adt; use trans::common::*; use trans::machine; -use middle::ty::{self, Ty, TypeFoldable}; +use rustc::ty::{self, Ty, TypeFoldable}; use trans::type_::Type; @@ -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_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 3b3d2cbad10cc..af40b845767d8 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::ty::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 947488bde71dd..f8fa9c8e9b6cb 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::ty::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 91916efa88277..f7726bc9cf492 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 bf60f435a2213..4e582033c8b6a 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 31c0fea5c2d97..7ca4251e4c80b 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 54b2c8c59234e..9333b10d27e4a 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::ty::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 c62922a33de2c..dad7d7cd26ca3 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 eee3fddcaea3d..6d429fa7b73a1 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::ty::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 1f61198bef921..d8bdf6c61aad4 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 fd5d06ea9d19e..bf2388ab79315 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::ty::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 9440be50e2106..8720469a72476 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::ty::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 b8c1d43b7c475..310245f0a0e10 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::ty::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 6648236f33ae0..11f7feba86b32 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::ty::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 6be822aebcadf..4b42846297b16 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::ty::subst; -use middle::ty::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 b940c073a7fec..aae7912cace40 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::ty::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 8d025e164224d..c5a0657594eb2 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::ty::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 f4841b75d13d5..281564af6158a 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 afbe511dda89f..533d24686e71f 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::ty::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 2bb8c874d20d6..69e49e6a98646 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 af33b6b394e5f..047dfec1796eb 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::ty::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 20c86f9a17c8d..7ede85454e90f 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 af4975091055a..c3b46ef83acef 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::ty::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 56e6d0399036d..eba3e56c72207 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 78ae8fa65f840..d7d4560a4eac3 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 fbb1653b06a07..6d77200daa384 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 a282165d1a041..0b447b2009b58 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::ty::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 016ff3b5a067b..7e8b08c58539b 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::ty::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 ccc79b0748c20..9b0fdd8a2e327 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::ty::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 1b02c736dce3b..793dba1e3f5f8 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 f46edb03b95b7..1ed355c90a546 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::ty::subst; -use middle::ty::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 ab37ef952c9a9..ee9f317f20fd0 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 c5e925226d07e..0763cfd7e2e60 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::ty::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 7148afb5e856c..c6f82ba42e6be 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::ty::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 2749dce5c73f4..02a2ceb360d7f 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 75bf1036fa2cc..94dead3c00577 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::ty::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 675bebe91c312..d21fd5364b054 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::ty::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 4cce835899203..e6a4d882c0449 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::ty::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 c30fd39616c44..15a10a84e4362 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 fdfbc98b0078a..3e1b46522a98d 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 865784c2f1eed..0c4aae8cfad36 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 4ff531d4755c8..7454bbfb53146 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}; From 00e77be6c98c6ba178093ea4b430901e15ce41fb Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 22 Mar 2016 18:40:24 +0200 Subject: [PATCH 3/4] rustc_trans: move save to librustc_save_analysis. --- mk/crates.mk | 5 +-- src/librustc_driver/Cargo.toml | 1 + src/librustc_driver/lib.rs | 3 +- src/librustc_save_analysis/Cargo.toml | 15 +++++++++ .../csv_dumper.rs | 2 +- .../save => librustc_save_analysis}/data.rs | 2 +- .../save => librustc_save_analysis}/dump.rs | 0 .../dump_visitor.rs | 7 ++-- .../mod.rs => librustc_save_analysis/lib.rs} | 32 +++++++++++++++---- .../span_utils.rs | 2 +- src/librustc_trans/lib.rs | 1 - 11 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 src/librustc_save_analysis/Cargo.toml rename src/{librustc_trans/save => librustc_save_analysis}/csv_dumper.rs (99%) rename src/{librustc_trans/save => librustc_save_analysis}/data.rs (99%) rename src/{librustc_trans/save => librustc_save_analysis}/dump.rs (100%) rename src/{librustc_trans/save => librustc_save_analysis}/dump_visitor.rs (99%) rename src/{librustc_trans/save/mod.rs => librustc_save_analysis/lib.rs} (97%) rename src/{librustc_trans/save => librustc_save_analysis}/span_utils.rs (99%) diff --git a/mk/crates.mk b/mk/crates.mk index 54733083aaeb0..ae40a8e7f70dc 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_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index bf86e8f039ad4..c8c517934443d 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/lib.rs b/src/librustc_driver/lib.rs index dc30b4f91a985..c474b0e33dc47 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_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml new file mode 100644 index 0000000000000..a0cf70b57a9d4 --- /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 2a5b7d9567be7..3021d4e9820b7 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 b9d9d58b5bdcd..997a635f69e0d 100644 --- a/src/librustc_trans/save/data.rs +++ b/src/librustc_save_analysis/data.rs @@ -15,7 +15,7 @@ use std::hash::Hasher; -use middle::def_id::DefId; +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 9d465d8704708..88b72ccf3296c 100644 --- a/src/librustc_trans/save/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -27,10 +27,9 @@ //! 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 rustc::middle::def::Def; +use rustc::middle::def_id::DefId; +use rustc::session::Session; use rustc::ty::{self, TyCtxt}; use std::collections::HashSet; 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 a037f8d6ea0eb..5dcb6473ec2e3 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. +#![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 middle::def::Def; -use middle::def_id::DefId; 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 2a5c61f4e9d2a..4080607eed51d 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/lib.rs b/src/librustc_trans/lib.rs index f8bbde6010940..29fde20e626d4 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -76,7 +76,6 @@ pub mod back { pub mod diagnostics; pub mod trans; -pub mod save; pub mod lib { pub use llvm; From 7eb0547b5e5ab3c40b35ade1155bc1f58db729e6 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 22 Mar 2016 19:23:36 +0200 Subject: [PATCH 4/4] rustc_trans: move the contents of the trans module to top-level. --- src/librustc_driver/driver.rs | 2 +- src/librustc_trans/{trans => }/_match.rs | 36 ++++---- src/librustc_trans/{trans => }/abi.rs | 32 ++++---- src/librustc_trans/{trans => }/adt.rs | 30 +++---- src/librustc_trans/{trans => }/asm.rs | 12 +-- .../{trans => }/assert_dep_graph.rs | 0 src/librustc_trans/{trans => }/attributes.rs | 2 +- src/librustc_trans/back/link.rs | 4 +- src/librustc_trans/back/linker.rs | 2 +- src/librustc_trans/back/write.rs | 2 +- src/librustc_trans/{trans => }/base.rs | 78 +++++++++--------- src/librustc_trans/{trans => }/basic_block.rs | 2 +- src/librustc_trans/{trans => }/build.rs | 10 +-- src/librustc_trans/{trans => }/builder.rs | 10 +-- .../{trans => }/cabi_aarch64.rs | 6 +- src/librustc_trans/{trans => }/cabi_arm.rs | 6 +- src/librustc_trans/{trans => }/cabi_asmjs.rs | 4 +- src/librustc_trans/{trans => }/cabi_mips.rs | 6 +- .../{trans => }/cabi_powerpc.rs | 6 +- .../{trans => }/cabi_powerpc64.rs | 6 +- src/librustc_trans/{trans => }/cabi_x86.rs | 4 +- src/librustc_trans/{trans => }/cabi_x86_64.rs | 6 +- .../{trans => }/cabi_x86_win64.rs | 4 +- src/librustc_trans/{trans => }/callee.rs | 52 ++++++------ src/librustc_trans/{trans => }/cleanup.rs | 18 ++-- src/librustc_trans/{trans => }/closure.rs | 32 ++++---- src/librustc_trans/{trans => }/collector.rs | 14 ++-- src/librustc_trans/{trans => }/common.rs | 44 +++++----- src/librustc_trans/{trans => }/consts.rs | 30 +++---- src/librustc_trans/{trans => }/context.rs | 22 ++--- src/librustc_trans/{trans => }/controlflow.rs | 33 ++++---- src/librustc_trans/{trans => }/datum.rs | 18 ++-- .../{trans => }/debuginfo/create_scope_map.rs | 2 +- .../{trans => }/debuginfo/doc.rs | 0 .../{trans => }/debuginfo/gdb.rs | 6 +- .../{trans => }/debuginfo/metadata.rs | 8 +- .../{trans => }/debuginfo/mod.rs | 9 +- .../{trans => }/debuginfo/namespace.rs | 2 +- .../{trans => }/debuginfo/source_loc.rs | 2 +- .../{trans => }/debuginfo/type_names.rs | 4 +- .../{trans => }/debuginfo/utils.rs | 6 +- src/librustc_trans/{trans => }/declare.rs | 8 +- src/librustc_trans/{trans => }/disr.rs | 0 src/librustc_trans/{trans => }/expr.rs | 34 ++++---- src/librustc_trans/{trans => }/glue.rs | 36 ++++---- src/librustc_trans/{trans => }/inline.rs | 6 +- src/librustc_trans/{trans => }/intrinsic.rs | 38 ++++----- src/librustc_trans/lib.rs | 68 ++++++++++++++- src/librustc_trans/{trans => }/machine.rs | 4 +- src/librustc_trans/{trans => }/macros.rs | 0 src/librustc_trans/{trans => }/meth.rs | 30 +++---- src/librustc_trans/{trans => }/mir/analyze.rs | 2 +- src/librustc_trans/{trans => }/mir/block.rs | 32 ++++---- .../{trans => }/mir/constant.rs | 14 ++-- src/librustc_trans/{trans => }/mir/drop.rs | 12 +-- src/librustc_trans/{trans => }/mir/lvalue.rs | 18 ++-- src/librustc_trans/{trans => }/mir/mod.rs | 4 +- src/librustc_trans/{trans => }/mir/operand.rs | 10 +-- src/librustc_trans/{trans => }/mir/rvalue.rs | 30 +++---- .../{trans => }/mir/statement.rs | 2 +- .../{trans => }/monomorphize.rs | 14 ++-- src/librustc_trans/trans/mod.rs | 82 ------------------- src/librustc_trans/{trans => }/tvec.rs | 30 +++---- src/librustc_trans/{trans => }/type_.rs | 2 +- src/librustc_trans/{trans => }/type_of.rs | 10 +-- src/librustc_trans/{trans => }/value.rs | 4 +- 66 files changed, 521 insertions(+), 541 deletions(-) rename src/librustc_trans/{trans => }/_match.rs (99%) rename src/librustc_trans/{trans => }/abi.rs (97%) rename src/librustc_trans/{trans => }/adt.rs (99%) rename src/librustc_trans/{trans => }/asm.rs (96%) rename src/librustc_trans/{trans => }/assert_dep_graph.rs (100%) rename src/librustc_trans/{trans => }/attributes.rs (99%) rename src/librustc_trans/{trans => }/base.rs (98%) rename src/librustc_trans/{trans => }/basic_block.rs (97%) rename src/librustc_trans/{trans => }/build.rs (99%) rename src/librustc_trans/{trans => }/builder.rs (99%) rename src/librustc_trans/{trans => }/cabi_aarch64.rs (98%) rename src/librustc_trans/{trans => }/cabi_arm.rs (98%) rename src/librustc_trans/{trans => }/cabi_asmjs.rs (95%) rename src/librustc_trans/{trans => }/cabi_mips.rs (97%) rename src/librustc_trans/{trans => }/cabi_powerpc.rs (97%) rename src/librustc_trans/{trans => }/cabi_powerpc64.rs (98%) rename src/librustc_trans/{trans => }/cabi_x86.rs (97%) rename src/librustc_trans/{trans => }/cabi_x86_64.rs (99%) rename src/librustc_trans/{trans => }/cabi_x86_win64.rs (95%) rename src/librustc_trans/{trans => }/callee.rs (98%) rename src/librustc_trans/{trans => }/cleanup.rs (99%) rename src/librustc_trans/{trans => }/closure.rs (97%) rename src/librustc_trans/{trans => }/collector.rs (99%) rename src/librustc_trans/{trans => }/common.rs (98%) rename src/librustc_trans/{trans => }/consts.rs (98%) rename src/librustc_trans/{trans => }/context.rs (99%) rename src/librustc_trans/{trans => }/controlflow.rs (96%) rename src/librustc_trans/{trans => }/datum.rs (99%) rename src/librustc_trans/{trans => }/debuginfo/create_scope_map.rs (99%) rename src/librustc_trans/{trans => }/debuginfo/doc.rs (100%) rename src/librustc_trans/{trans => }/debuginfo/gdb.rs (97%) rename src/librustc_trans/{trans => }/debuginfo/metadata.rs (99%) rename src/librustc_trans/{trans => }/debuginfo/mod.rs (99%) rename src/librustc_trans/{trans => }/debuginfo/namespace.rs (99%) rename src/librustc_trans/{trans => }/debuginfo/source_loc.rs (99%) rename src/librustc_trans/{trans => }/debuginfo/type_names.rs (98%) rename src/librustc_trans/{trans => }/debuginfo/utils.rs (97%) rename src/librustc_trans/{trans => }/declare.rs (98%) rename src/librustc_trans/{trans => }/disr.rs (100%) rename src/librustc_trans/{trans => }/expr.rs (99%) rename src/librustc_trans/{trans => }/glue.rs (97%) rename src/librustc_trans/{trans => }/inline.rs (98%) rename src/librustc_trans/{trans => }/intrinsic.rs (99%) rename src/librustc_trans/{trans => }/machine.rs (98%) rename src/librustc_trans/{trans => }/macros.rs (100%) rename src/librustc_trans/{trans => }/meth.rs (97%) rename src/librustc_trans/{trans => }/mir/analyze.rs (99%) rename src/librustc_trans/{trans => }/mir/block.rs (97%) rename src/librustc_trans/{trans => }/mir/constant.rs (96%) rename src/librustc_trans/{trans => }/mir/drop.rs (87%) rename src/librustc_trans/{trans => }/mir/lvalue.rs (97%) rename src/librustc_trans/{trans => }/mir/mod.rs (99%) rename src/librustc_trans/{trans => }/mir/operand.rs (98%) rename src/librustc_trans/{trans => }/mir/rvalue.rs (98%) rename src/librustc_trans/{trans => }/mir/statement.rs (98%) rename src/librustc_trans/{trans => }/monomorphize.rs (97%) delete mode 100644 src/librustc_trans/trans/mod.rs rename src/librustc_trans/{trans => }/tvec.rs (97%) rename src/librustc_trans/{trans => }/type_.rs (99%) rename src/librustc_trans/{trans => }/type_of.rs (99%) rename src/librustc_trans/{trans => }/value.rs (98%) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 3520d74187583..a8f0d4a661474 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -29,7 +29,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_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 7794ac763c6a1..008323ee5bf31 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/_match.rs @@ -201,23 +201,23 @@ use middle::mem_categorization as mc; use middle::mem_categorization::Categorization; use middle::pat_util::*; use rustc::ty::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 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; @@ -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 8725392417288..dd72322997af8 100644 --- a/src/librustc_trans/trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -9,22 +9,22 @@ // 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 rustc::ty::{self, Ty}; 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 f14c1a573cccc..7c190c2ff7121 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/adt.rs @@ -53,21 +53,21 @@ 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 4d0c55131f765..41f1f4ae5f8ba 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 100% rename from src/librustc_trans/trans/assert_dep_graph.rs rename to src/librustc_trans/assert_dep_graph.rs 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 4ea920c57aadb..cbf176cd87f70 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 bcb56f4baf669..89c0a9da6f24c 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -25,7 +25,9 @@ use middle::cstore::{LinkagePreference, NativeLibraryKind}; use middle::dependency_format::Linkage; use rustc::ty::{Ty, TyCtxt}; use rustc::front::map::DefPath; -use trans::{CrateContext, CrateTranslation, gensym_name}; +use CrateTranslation; +use common::gensym_name; +use context::CrateContext; use util::common::time; use util::sha2::{Digest, Sha256}; use util::fs::fix_windows_verbatim_for_gcc; diff --git a/src/librustc_trans/back/linker.rs b/src/librustc_trans/back/linker.rs index b6b330c3734b0..f0274eeb862c4 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/write.rs b/src/librustc_trans/back/write.rs index 92d8b928ef428..2de650a59beda 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 ae7e6a924ab9c..34726720afcc3 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/base.rs @@ -51,45 +51,45 @@ 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::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 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 d3d055cda1202..919ea49b392c6 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 53e64c086a8db..0ce7fdb8b6d1d 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 869e9212b1cf6..55f65d29bfd6d 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 6eea8d472ba55..b2929d118a6af 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 14ca77836c28f..5dbcf1ef86ea5 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 c901442f48548..3cbc378ab0216 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 0d5e81be92142..d0fce01ce73a9 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 9aa89a04d0a9a..c9751aa25c1e2 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 340de235732f9..7e7033b4686e0 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 9e6c4d9af42ee..415579eb221dd 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 47d373f90431e..a08d9fb5b4095 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 43f72c454cf02..a5077f68fb58c 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 98% rename from src/librustc_trans/trans/callee.rs rename to src/librustc_trans/callee.rs index 4c9999d49624e..d530f31b676af 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/callee.rs @@ -27,32 +27,32 @@ 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 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; 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 78481e0ed9251..3a8dc144f9c7e 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/cleanup.rs @@ -120,16 +120,16 @@ 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 type_::Type; +use value::Value; use rustc::ty::{Ty, TyCtxt}; use std::fmt; diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/closure.rs similarity index 97% rename from src/librustc_trans/trans/closure.rs rename to src/librustc_trans/closure.rs index 7b71109f5a2fa..dd8848eb6e72b 100644 --- a/src/librustc_trans/trans/closure.rs +++ b/src/librustc_trans/closure.rs @@ -14,22 +14,22 @@ use llvm::{ValueRef, get_param, get_params}; use middle::def_id::DefId; use rustc::infer; use rustc::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 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; 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 07989c4290db1..1d81d30fbf24d 100644 --- a/src/librustc_trans/trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -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}; @@ -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 a6953f262c8ce..c5d54e30f13fa 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/common.rs @@ -22,21 +22,21 @@ use middle::def_id::DefId; use rustc::infer; use middle::lang_items::LangItem; use rustc::ty::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 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}; @@ -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 9cdb168df8543..b7d4ff3f42265 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/consts.rs @@ -17,21 +17,21 @@ 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 {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}; 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 2da61c49ed20d..d4e0aa3a4948c 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/context.rs @@ -17,17 +17,17 @@ use middle::def_id::DefId; 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::monomorphize::Instance; -use trans::collector::{TransItem, TransItemState}; -use trans::type_::{Type, TypeNames}; +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 collector::{TransItem, TransItemState}; +use type_::{Type, TypeNames}; use rustc::ty::subst::{Substs, VecPerParamSpace}; use rustc::ty::{self, Ty, TyCtxt}; use session::config::NoDebugInfo; diff --git a/src/librustc_trans/trans/controlflow.rs b/src/librustc_trans/controlflow.rs similarity index 96% rename from src/librustc_trans/trans/controlflow.rs rename to src/librustc_trans/controlflow.rs index 80ff11e968a18..04562087af7b7 100644 --- a/src/librustc_trans/trans/controlflow.rs +++ b/src/librustc_trans/controlflow.rs @@ -12,19 +12,18 @@ use llvm::ValueRef; use middle::def::Def; use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem}; use rustc::ty::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 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 c0858a6d93bf6..6f96b5769bfe3 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/datum.rs @@ -93,15 +93,15 @@ 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 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; 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 41fed12e7bf3c..20e8a3fb0cfec 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 4e3fadd0fa911..d9e36b4f68134 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 bd2a8e0193dae..af7ccdb6cf51e 100644 --- a/src/librustc_trans/trans/debuginfo/metadata.rs +++ b/src/librustc_trans/debuginfo/metadata.rs @@ -29,10 +29,10 @@ use middle::pat_util; 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 {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; diff --git a/src/librustc_trans/trans/debuginfo/mod.rs b/src/librustc_trans/debuginfo/mod.rs similarity index 99% rename from src/librustc_trans/trans/debuginfo/mod.rs rename to src/librustc_trans/debuginfo/mod.rs index 198a9899fdae0..66e33698389ae 100644 --- a/src/librustc_trans/trans/debuginfo/mod.rs +++ b/src/librustc_trans/debuginfo/mod.rs @@ -32,10 +32,9 @@ 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 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}; @@ -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 0c2c29724a1d7..552188ae2a6eb 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 981a23fd664a9..2879da7d03b81 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 fc9ace89ab7c3..71dd3e432df0d 100644 --- a/src/librustc_trans/trans/debuginfo/type_names.rs +++ b/src/librustc_trans/debuginfo/type_names.rs @@ -12,7 +12,7 @@ use super::namespace::crate_root_namespace; -use trans::common::CrateContext; +use common::CrateContext; use middle::def_id::DefId; use rustc::infer; use rustc::ty::subst; @@ -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 c1d7bb495fafd..d2ae74569e711 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 98% rename from src/librustc_trans/trans/declare.rs rename to src/librustc_trans/declare.rs index 41a87f8d6de46..28a70fd5e0bde 100644 --- a/src/librustc_trans/trans/declare.rs +++ b/src/librustc_trans/declare.rs @@ -22,10 +22,10 @@ use llvm::{self, ValueRef}; use rustc::ty; use rustc::infer; -use trans::abi::{Abi, FnType}; -use trans::attributes; -use trans::context::CrateContext; -use trans::type_::Type; +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 100% rename from src/librustc_trans/trans/disr.rs rename to src/librustc_trans/disr.rs 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 8f9f44fb2ddf8..b2e2e93a2be4c 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/expr.rs @@ -55,21 +55,21 @@ use llvm::{self, ValueRef, TypeKind}; use middle::const_qualif::ConstQualif; use middle::def::Def; use rustc::ty::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 {_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; @@ -77,8 +77,8 @@ 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; 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 596d8c7e9b7a2..c9f31f7642fcd 100644 --- a/src/librustc_trans/trans/glue.rs +++ b/src/librustc_trans/glue.rs @@ -21,24 +21,24 @@ use middle::lang_items::ExchangeFreeFnLangItem; use rustc::ty::subst::{Substs}; use rustc::traits; use rustc::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 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 85a2adfe0df7b..50579c7de99bb 100644 --- a/src/librustc_trans/trans/inline.rs +++ b/src/librustc_trans/inline.rs @@ -12,9 +12,9 @@ use llvm::{AvailableExternallyLinkage, InternalLinkage, SetLinkage}; use middle::cstore::{CrateStore, FoundAst, InlinedItem}; use middle::def_id::DefId; use rustc::ty::subst::Substs; -use trans::base::{push_ctxt, trans_item, trans_fn}; -use trans::callee::Callee; -use trans::common::*; +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 9577a1817d75d..b7b74e44d3ed4 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/intrinsic.rs @@ -18,26 +18,26 @@ use llvm::{ValueRef, TypeKind}; use rustc::infer; use rustc::ty::subst; use rustc::ty::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 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 trans::Disr; +use Disr; use rustc::ty::subst::Substs; use rustc::dep_graph::DepNode; use rustc_front::hir; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 29fde20e626d4..8ce69b55222e1 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; @@ -75,10 +78,69 @@ pub mod back { pub mod diagnostics; -pub mod trans; +#[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 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 mod lib { - pub use llvm; +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 691fba42d5705..59020b38ddcd3 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 97% rename from src/librustc_trans/trans/meth.rs rename to src/librustc_trans/meth.rs index 86ddc86e40744..2a0b60842310e 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/meth.rs @@ -18,21 +18,21 @@ use rustc::infer; use rustc::ty::subst::{FnSpace, Subst, Substs}; use rustc::ty::subst; use rustc::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 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; 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 23cca55e4d480..9aa3d6c7dd08e 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 4f76fd5668456..a60b03dd72413 100644 --- a/src/librustc_trans/trans/mir/block.rs +++ b/src/librustc_trans/mir/block.rs @@ -11,19 +11,19 @@ use llvm::{self, BasicBlockRef, ValueRef, OperandBundleDef}; 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 1e5c1c2c55a00..be1c3f3b56b2c 100644 --- a/src/librustc_trans/trans/mir/constant.rs +++ b/src/librustc_trans/mir/constant.rs @@ -13,14 +13,14 @@ 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 87% rename from src/librustc_trans/trans/mir/drop.rs rename to src/librustc_trans/mir/drop.rs index cc033084ace60..623cd5a6f8cc9 100644 --- a/src/librustc_trans/trans/mir/drop.rs +++ b/src/librustc_trans/mir/drop.rs @@ -10,12 +10,12 @@ use llvm::ValueRef; use rustc::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 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 6271ad8d8b846..f5f8c23a9824b 100644 --- a/src/librustc_trans/trans/mir/lvalue.rs +++ b/src/librustc_trans/mir/lvalue.rs @@ -12,16 +12,16 @@ use llvm::ValueRef; 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 99% rename from src/librustc_trans/trans/mir/mod.rs rename to src/librustc_trans/mir/mod.rs index ed4aa5fe58304..61536f3ecae87 100644 --- a/src/librustc_trans/trans/mir/mod.rs +++ b/src/librustc_trans/mir/mod.rs @@ -13,8 +13,8 @@ use llvm::{self, ValueRef}; 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 98% rename from src/librustc_trans/trans/mir/operand.rs rename to src/librustc_trans/mir/operand.rs index cc1446033de33..3b909353f7345 100644 --- a/src/librustc_trans/trans/mir/operand.rs +++ b/src/librustc_trans/mir/operand.rs @@ -11,11 +11,11 @@ use llvm::ValueRef; 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 a78d0da5be4a7..47fa618ebad83 100644 --- a/src/librustc_trans/trans/mir/rvalue.rs +++ b/src/librustc_trans/mir/rvalue.rs @@ -15,20 +15,20 @@ 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 0307fd649c835..d291bc19db5e8 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 97% rename from src/librustc_trans/trans/monomorphize.rs rename to src/librustc_trans/monomorphize.rs index a587de2e2db92..0c49c37220965 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/monomorphize.rs @@ -16,14 +16,14 @@ use rustc::infer::normalize_associated_type; use rustc::ty::subst; use rustc::ty::subst::{Subst, Substs}; use rustc::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 attributes; +use base::{push_ctxt}; +use base::trans_fn; +use base; +use common::*; +use declare; use rustc::ty::{self, Ty, TyCtxt}; -use trans::Disr; +use Disr; use rustc::front::map as hir_map; use rustc::util::ppaux; diff --git a/src/librustc_trans/trans/mod.rs b/src/librustc_trans/trans/mod.rs deleted file mode 100644 index c5ab0d4e74421..0000000000000 --- a/src/librustc_trans/trans/mod.rs +++ /dev/null @@ -1,82 +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; - -#[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 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 4a7404b1fbacd..c42bad0bc0bd1 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/tvec.rs @@ -12,21 +12,21 @@ 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 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 57bd0ba815816..910a1c7f729c9 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 99% rename from src/librustc_trans/trans/type_of.rs rename to src/librustc_trans/type_of.rs index 00f42a3b243c7..02f659fdc2e6f 100644 --- a/src/librustc_trans/trans/type_of.rs +++ b/src/librustc_trans/type_of.rs @@ -13,13 +13,13 @@ use middle::def_id::DefId; use rustc::infer; use rustc::ty::subst; -use trans::abi::FnType; -use trans::adt; -use trans::common::*; -use trans::machine; +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; 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 a33b7d62d2dce..00b316cc420ee 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;