Skip to content

Commit f027607

Browse files
committed
rustc: middle: move TraitMap from resolve to ty.
1 parent d8f57c3 commit f027607

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/librustc/middle/resolve.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use middle::lang_items::LanguageItems;
4343
use middle::pat_util::pat_bindings;
4444
use middle::subst::{ParamSpace, FnSpace, TypeSpace};
4545
use middle::ty::{ExplicitSelfCategory, StaticExplicitSelfCategory};
46-
use middle::ty::{CaptureModeMap, Freevar, FreevarMap};
46+
use middle::ty::{CaptureModeMap, Freevar, FreevarMap, TraitMap};
4747
use util::nodemap::{NodeMap, NodeSet, DefIdSet, FnvHashMap};
4848

4949
use syntax::ast::{Arm, BindByRef, BindByValue, BindingMode, Block, Crate, CrateNum};
@@ -93,9 +93,6 @@ struct BindingInfo {
9393
// Map from the name in a pattern to its binding mode.
9494
type BindingMap = HashMap<Name, BindingInfo>;
9595

96-
// Trait method resolution
97-
pub type TraitMap = NodeMap<Vec<DefId>>;
98-
9996
// This is the replacement export map. It maps a module to all of the exports
10097
// within.
10198
pub type ExportMap = NodeMap<Vec<Export>>;

src/librustc/middle/ty.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6262,6 +6262,9 @@ pub type FreevarMap = NodeMap<Vec<Freevar>>;
62626262

62636263
pub type CaptureModeMap = NodeMap<ast::CaptureClause>;
62646264

6265+
// Trait method resolution
6266+
pub type TraitMap = NodeMap<Vec<DefId>>;
6267+
62656268
pub fn with_freevars<T, F>(tcx: &ty::ctxt, fid: ast::NodeId, f: F) -> T where
62666269
F: FnOnce(&[Freevar]) -> T,
62676270
{

src/librustc_typeck/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ pub use rustc::session;
9090
pub use rustc::util;
9191

9292
use middle::def;
93-
use middle::resolve;
9493
use middle::infer;
9594
use middle::subst;
9695
use middle::subst::VecPerParamSpace;
@@ -121,7 +120,7 @@ struct TypeAndSubsts<'tcx> {
121120

122121
struct CrateCtxt<'a, 'tcx: 'a> {
123122
// A mapping from method call sites to traits that have that method.
124-
trait_map: resolve::TraitMap,
123+
trait_map: ty::TraitMap,
125124
tcx: &'a ty::ctxt<'tcx>
126125
}
127126

@@ -316,7 +315,7 @@ fn check_for_entry_fn(ccx: &CrateCtxt) {
316315
}
317316
}
318317

319-
pub fn check_crate(tcx: &ty::ctxt, trait_map: resolve::TraitMap) {
318+
pub fn check_crate(tcx: &ty::ctxt, trait_map: ty::TraitMap) {
320319
let time_passes = tcx.sess.time_passes();
321320
let ccx = CrateCtxt {
322321
trait_map: trait_map,

0 commit comments

Comments
 (0)