diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 45aa6f881e8..3d187cfc081 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -665,7 +665,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// reference to the context, to allow formatting values that need it. pub fn create_and_enter(s: &'tcx Session, arenas: &'tcx CtxtArenas<'tcx>, - def_map: RefCell, + def_map: DefMap, named_region_map: resolve_lifetime::NamedRegionMap, map: ast_map::Map<'tcx>, freevars: FreevarMap, @@ -693,7 +693,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { item_variance_map: RefCell::new(DepTrackingMap::new(dep_graph.clone())), variance_computed: Cell::new(false), sess: s, - def_map: def_map, + def_map: RefCell::new(def_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())), diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index d6d944fde5f..cbbbd84ec50 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -44,7 +44,6 @@ use super::Compilation; use serialize::json; -use std::cell::RefCell; use std::collections::HashMap; use std::env; use std::ffi::{OsString, OsStr}; @@ -893,7 +892,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session, let trait_map = resolutions.trait_map; TyCtxt::create_and_enter(sess, arenas, - RefCell::new(resolutions.def_map), + resolutions.def_map, named_region_map, hir_map, resolutions.freevars, diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index b1df80403c0..6423d94e6f6 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -29,7 +29,6 @@ use rustc_metadata::cstore::CStore; use rustc_metadata::creader::read_local_crates; use rustc::hir::map as hir_map; use rustc::session::{self, config}; -use std::cell::RefCell; use std::rc::Rc; use syntax::ast; use syntax::abi::Abi; @@ -140,7 +139,7 @@ fn test_env(source_string: &str, let index = stability::Index::new(&ast_map); TyCtxt::create_and_enter(&sess, &arenas, - RefCell::new(resolutions.def_map), + resolutions.def_map, named_region_map.unwrap(), ast_map, resolutions.freevars,