Rollup merge of #33977 - Ms2ger:create-and-enter, r=nrc
Take the def_map argument to TyCtxt::create_and_enter out of its RefCell.
This commit is contained in:
commit
42e593a540
@ -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<F, R>(s: &'tcx Session,
|
||||
arenas: &'tcx CtxtArenas<'tcx>,
|
||||
def_map: RefCell<DefMap>,
|
||||
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())),
|
||||
|
@ -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,
|
||||
|
@ -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<F>(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,
|
||||
|
Loading…
Reference in New Issue
Block a user