1
Fork 0

Take the def_map argument to TyCtxt::create_and_enter out of its RefCell.

This commit is contained in:
Ms2ger 2016-05-31 09:21:49 +02:00
parent a967611d8f
commit 7463c95183
3 changed files with 4 additions and 6 deletions

View file

@ -665,7 +665,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
/// reference to the context, to allow formatting values that need it. /// reference to the context, to allow formatting values that need it.
pub fn create_and_enter<F, R>(s: &'tcx Session, pub fn create_and_enter<F, R>(s: &'tcx Session,
arenas: &'tcx CtxtArenas<'tcx>, arenas: &'tcx CtxtArenas<'tcx>,
def_map: RefCell<DefMap>, def_map: DefMap,
named_region_map: resolve_lifetime::NamedRegionMap, named_region_map: resolve_lifetime::NamedRegionMap,
map: ast_map::Map<'tcx>, map: ast_map::Map<'tcx>,
freevars: FreevarMap, freevars: FreevarMap,
@ -693,7 +693,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
item_variance_map: RefCell::new(DepTrackingMap::new(dep_graph.clone())), item_variance_map: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
variance_computed: Cell::new(false), variance_computed: Cell::new(false),
sess: s, sess: s,
def_map: def_map, def_map: RefCell::new(def_map),
tables: RefCell::new(Tables::empty()), tables: RefCell::new(Tables::empty()),
impl_trait_refs: RefCell::new(DepTrackingMap::new(dep_graph.clone())), impl_trait_refs: RefCell::new(DepTrackingMap::new(dep_graph.clone())),
trait_defs: RefCell::new(DepTrackingMap::new(dep_graph.clone())), trait_defs: RefCell::new(DepTrackingMap::new(dep_graph.clone())),

View file

@ -44,7 +44,6 @@ use super::Compilation;
use serialize::json; use serialize::json;
use std::cell::RefCell;
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;
use std::ffi::{OsString, OsStr}; 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; let trait_map = resolutions.trait_map;
TyCtxt::create_and_enter(sess, TyCtxt::create_and_enter(sess,
arenas, arenas,
RefCell::new(resolutions.def_map), resolutions.def_map,
named_region_map, named_region_map,
hir_map, hir_map,
resolutions.freevars, resolutions.freevars,

View file

@ -29,7 +29,6 @@ use rustc_metadata::cstore::CStore;
use rustc_metadata::creader::read_local_crates; use rustc_metadata::creader::read_local_crates;
use rustc::hir::map as hir_map; use rustc::hir::map as hir_map;
use rustc::session::{self, config}; use rustc::session::{self, config};
use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::abi::Abi; use syntax::abi::Abi;
@ -140,7 +139,7 @@ fn test_env<F>(source_string: &str,
let index = stability::Index::new(&ast_map); let index = stability::Index::new(&ast_map);
TyCtxt::create_and_enter(&sess, TyCtxt::create_and_enter(&sess,
&arenas, &arenas,
RefCell::new(resolutions.def_map), resolutions.def_map,
named_region_map.unwrap(), named_region_map.unwrap(),
ast_map, ast_map,
resolutions.freevars, resolutions.freevars,