From f0276072a3ee4596cacda9b2155ca57a07ec0683 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Thu, 18 Dec 2014 21:04:28 +0200 Subject: [PATCH] rustc: middle: move TraitMap from resolve to ty. --- src/librustc/middle/resolve.rs | 5 +---- src/librustc/middle/ty.rs | 3 +++ src/librustc_typeck/lib.rs | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index be46b80b54d..16d6dff242b 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -43,7 +43,7 @@ use middle::lang_items::LanguageItems; 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; -// Trait method resolution -pub type TraitMap = NodeMap>; - // This is the replacement export map. It maps a module to all of the exports // within. pub type ExportMap = NodeMap>; diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index e93f3ca7d2e..59bf1900d30 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -6262,6 +6262,9 @@ pub type FreevarMap = NodeMap>; pub type CaptureModeMap = NodeMap; +// Trait method resolution +pub type TraitMap = NodeMap>; + pub fn with_freevars(tcx: &ty::ctxt, fid: ast::NodeId, f: F) -> T where F: FnOnce(&[Freevar]) -> T, { diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 5fc2466674e..ec0313d4d8f 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -90,7 +90,6 @@ pub use rustc::session; 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,