/// reference to the context, to allow formatting values that need it.
pub fn create_and_enter<F, R>(s: &'tcx Session,
arenas: &'tcx CtxtArenas<'tcx>,
- trait_map: TraitMap,
+ resolutions: ty::Resolutions,
named_region_map: resolve_lifetime::NamedRegionMap,
map: ast_map::Map<'tcx>,
- freevars: FreevarMap,
- maybe_unused_trait_imports: NodeSet,
region_maps: RegionMaps,
lang_items: middle::lang_items::LanguageItems,
stability: stability::Index<'tcx>,
item_variance_map: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
variance_computed: Cell::new(false),
sess: s,
- trait_map: trait_map,
+ trait_map: resolutions.trait_map,
tables: RefCell::new(Tables::empty()),
impl_trait_refs: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
trait_defs: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
fulfilled_predicates: RefCell::new(fulfilled_predicates),
map: map,
mir_map: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
- freevars: RefCell::new(freevars),
- maybe_unused_trait_imports: maybe_unused_trait_imports,
+ freevars: RefCell::new(resolutions.freevars),
+ maybe_unused_trait_imports: resolutions.maybe_unused_trait_imports,
item_types: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
rcache: RefCell::new(FxHashMap()),
tc_cache: RefCell::new(FxHashMap()),
pub use self::fold::TypeFoldable;
use dep_graph::{self, DepNode};
-use hir::map as ast_map;
+use hir::{map as ast_map, FreevarMap, TraitMap};
use middle;
use hir::def::{Def, CtorKind, ExportMap};
use hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
pub hir_ty_to_ty: NodeMap<Ty<'tcx>>,
}
+#[derive(Clone)]
+pub struct Resolutions {
+ pub freevars: FreevarMap,
+ pub trait_map: TraitMap,
+ pub maybe_unused_trait_imports: NodeSet,
+}
+
#[derive(Copy, Clone)]
pub enum DtorKind {
NoDtor,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use rustc::hir;
-use rustc::hir::{map as hir_map, FreevarMap, TraitMap};
+use rustc::hir::{self, map as hir_map};
use rustc::hir::lowering::lower_crate;
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_mir as mir;
use rustc::lint;
use rustc::middle::{self, dependency_format, stability, reachable};
use rustc::middle::privacy::AccessLevels;
-use rustc::ty::{self, TyCtxt};
+use rustc::ty::{self, TyCtxt, Resolutions};
use rustc::util::common::time;
use rustc::util::nodemap::{NodeSet, NodeMap};
use rustc_borrowck as borrowck;
use derive_registrar;
-#[derive(Clone)]
-pub struct Resolutions {
- pub freevars: FreevarMap,
- pub trait_map: TraitMap,
- pub maybe_unused_trait_imports: NodeSet,
-}
-
pub fn compile_input(sess: &Session,
cstore: &CStore,
input: &Input,
TyCtxt::create_and_enter(sess,
arenas,
- resolutions.trait_map,
+ resolutions,
named_region_map,
hir_map,
- resolutions.freevars,
- resolutions.maybe_unused_trait_imports,
region_map,
lang_items,
index,
pub use self::PpMode::*;
use self::NodesMatchingUII::*;
-use abort_on_err;
-use driver::{self, Resolutions};
+use {abort_on_err, driver};
-use rustc::ty::{self, TyCtxt};
+use rustc::ty::{self, TyCtxt, Resolutions};
use rustc::cfg;
use rustc::cfg::graphviz::LabelledCFG;
use rustc::dep_graph::DepGraph;
let index = stability::Index::new(&ast_map);
TyCtxt::create_and_enter(&sess,
&arenas,
- resolutions.trait_map,
+ resolutions,
named_region_map.unwrap(),
ast_map,
- resolutions.freevars,
- resolutions.maybe_unused_trait_imports,
region_map,
lang_items,
index,