rustc: middle: move TraitMap from resolve to ty.

This commit is contained in:
Eduard Burtescu 2014-12-18 21:04:28 +02:00
parent d8f57c3804
commit f0276072a3
3 changed files with 6 additions and 7 deletions

View File

@ -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<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>>;

View File

@ -6262,6 +6262,9 @@ pub type FreevarMap = NodeMap<Vec<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,
{

View File

@ -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,