]> git.lizzy.rs Git - rust.git/commitdiff
rustc: middle: move TraitMap from resolve to ty.
authorEduard Burtescu <edy.burt@gmail.com>
Thu, 18 Dec 2014 19:04:28 +0000 (21:04 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Sat, 20 Dec 2014 05:25:41 +0000 (07:25 +0200)
src/librustc/middle/resolve.rs
src/librustc/middle/ty.rs
src/librustc_typeck/lib.rs

index be46b80b54df52ff3d68c2d1d4e38ddd646b5de8..16d6dff242b611cd7f52b88a1edcb2f3dfc0c81f 100644 (file)
@@ -43,7 +43,7 @@
 use middle::pat_util::pat_bindings;
 use middle::subst::{ParamSpace, FnSpace, TypeSpace};
 use middle::ty::{ExplicitSelfCategory, StaticExplicitSelfCategory};
-use middle::ty::{CaptureModeMap, Freevar, FreevarMap};
+use middle::ty::{CaptureModeMap, Freevar, FreevarMap, TraitMap};
 use util::nodemap::{NodeMap, NodeSet, DefIdSet, FnvHashMap};
 
 use syntax::ast::{Arm, BindByRef, BindByValue, BindingMode, Block, Crate, CrateNum};
@@ -93,9 +93,6 @@ struct BindingInfo {
 // Map from the name in a pattern to its binding mode.
 type BindingMap = HashMap<Name, BindingInfo>;
 
-// Trait method resolution
-pub type TraitMap = NodeMap<Vec<DefId>>;
-
 // This is the replacement export map. It maps a module to all of the exports
 // within.
 pub type ExportMap = NodeMap<Vec<Export>>;
index e93f3ca7d2e0ea799d0a7db44ead2aa849106710..59bf1900d30e5c27f256df8c1e8032a5091c282b 100644 (file)
@@ -6262,6 +6262,9 @@ pub struct Freevar {
 
 pub type CaptureModeMap = NodeMap<ast::CaptureClause>;
 
+// Trait method resolution
+pub type TraitMap = NodeMap<Vec<DefId>>;
+
 pub fn with_freevars<T, F>(tcx: &ty::ctxt, fid: ast::NodeId, f: F) -> T where
     F: FnOnce(&[Freevar]) -> T,
 {
index 5fc2466674ebe61dc9ba1bd5c51a7cf2364b1b6c..ec0313d4d8fd0fe7d651e4154ffa1ecdfc5b36e4 100644 (file)
@@ -90,7 +90,6 @@
 pub use rustc::util;
 
 use middle::def;
-use middle::resolve;
 use middle::infer;
 use middle::subst;
 use middle::subst::VecPerParamSpace;
@@ -121,7 +120,7 @@ struct TypeAndSubsts<'tcx> {
 
 struct CrateCtxt<'a, 'tcx: 'a> {
     // A mapping from method call sites to traits that have that method.
-    trait_map: resolve::TraitMap,
+    trait_map: ty::TraitMap,
     tcx: &'a ty::ctxt<'tcx>
 }
 
@@ -316,7 +315,7 @@ fn check_for_entry_fn(ccx: &CrateCtxt) {
     }
 }
 
-pub fn check_crate(tcx: &ty::ctxt, trait_map: resolve::TraitMap) {
+pub fn check_crate(tcx: &ty::ctxt, trait_map: ty::TraitMap) {
     let time_passes = tcx.sess.time_passes();
     let ccx = CrateCtxt {
         trait_map: trait_map,